AnnotationMethodHandlerAdapter should treat String return type with @ModelAttribute as model attribute instead of view name [SPR-4867] #9543
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Joris Kuipers opened SPR-4867 and commented
Currently, AnnotationMethodHandlerAdapter.getModelAndView treats all String return types as view names. It might make sense to support returning a String as a model attribute by annotating the method with
@ModelAttribute
. Even though this would be an incompatible change, the combination of@ModelAttribute
with a String return type is meaningless at the moment so this shouldn't cause any problems. Otherwise, I think that we should at least issue a warning if someone uses this combination.Affects: 2.5.4
Referenced from: commits 72cc060
The text was updated successfully, but these errors were encountered: