I'm trying to show a Flux of Strings from my Controller to a view in Thymeleaf but i'm getting just a ReactiveDataDriverContextVariable
on the view
I'm using Spring boot 2
This is my controller code
@GetMapping("/demo")
fun demo(model: Model): String{
val data = Flux.just("ONE", "TWO", "THREE", "FOUR")
model.addAttribute("data", ReactiveDataDriverContextVariable(data,1))
return "demo"
}
And this is my Thymeleaf template code
<table class="table table-striped table-responsive">
<tr th:each="c: ${data}">
<td th:text="${c}">...</td>
</tr>
</table>
As far as i know ReactiveDataDriverContextVariable
should put thymeleaf in a data-driven mode and show a list of the four Strings but i'm just getting this output:
org.thymeleaf.spring5.context.webflux.ReactiveDataDriverContextVariable@30ece48
I'm sure there is something i'm missing Thank you in advance
EDIT 1
Seems to be a problem with Spring Security
I have this configuration enabled
@EnableWebSecurity
class SecurityConfig : WebSecurityConfigurerAdapter() {
override fun configure(http: HttpSecurity) {
http.authorizeRequests()
.antMatchers("/demo")
.permitAll()
}
}
When i delete Spring Security configuration and dependency everything works just fine but i would like to secure the webapp
any ideas?