You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Fragment and FragmentsRendering in Kotlin. If I call something like that:
FragmentsRendering
.with("myView", mapOf("modelParam" to "modelValue"))
.build()
I get following error:
java.lang.UnsupportedOperationException: null
at java.base/java.util.Collections$SingletonMap.putIfAbsent(Collections.java:5291) ~[na:na]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ⇢ Handler MyController#getRequest(Id, Continuation) [DispatcherHandler]
Original Stack Trace:
at java.base/java.util.Collections$SingletonMap.putIfAbsent(Collections.java:5291) ~[na:na]
at org.springframework.web.reactive.result.view.Fragment.lambda$mergeAttributes$0(Fragment.java:97) ~[spring-webflux-6.2.5.jar:6.2.5]
at java.base/java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603) ~[na:na]
at org.springframework.web.reactive.result.view.Fragment.mergeAttributes(Fragment.java:97) ~[spring-webflux-6.2.5.jar:6.2.5]
at org.springframework.web.reactive.result.view.ViewResolutionResultHandler.renderFragment(ViewResolutionResultHandler.java:378) ~[spring-webflux-6.2.5.jar:6.2.5]
at org.springframework.web.reactive.result.view.ViewResolutionResultHandler.lambda$handleResult$0(ViewResolutionResultHandler.java:298) ~[spring-webflux-6.2.5.jar:6.2.5]
...
I found that Spring Webflux tries to add other parameters (in my case from a @ControllerAdvice) to the map. I have to migrate my model to a mutable map like
FragmentsRendering
.with("myView", mapOf("modelParam" to "modelValue").toMutableMap() asMap<String, Any>)
.build()
It would be nice if Spring Webflux could ensure that the map is mutable. Or if the builder is similar to Rendering and keeps its model map internal. Or at the very least, this contract should be documented at every function that accepts the model map.
The text was updated successfully, but these errors were encountered:
I use
Fragment
andFragmentsRendering
in Kotlin. If I call something like that:I get following error:
I found that Spring Webflux tries to add other parameters (in my case from a
@ControllerAdvice
) to the map. I have to migrate my model to a mutable map likeIt would be nice if Spring Webflux could ensure that the map is mutable. Or if the builder is similar to
Rendering
and keeps its model map internal. Or at the very least, this contract should be documented at every function that accepts the model map.The text was updated successfully, but these errors were encountered: