In https://docs.spring.io/spring-framework/docs/5.3.23/reference/html/web.html#mvc-ann-return-types, document states
Any return value that does not match any of the earlier values in this table and that is a String or void is treated as a view name (default view name selection through RequestToViewNameTranslator applies), provided it is not a simple type, as determined by BeanUtils#isSimpleProperty. Values that are simple types remain unresolved
However, it's unclear what will happen if a return value is not simple type and is not a String or void.
BTW, String or void is already in this table, so I think maybe there is a mistake here?
Comment From: rstoyanchev
Well spotted, this is confusing. Indeed String
and void
are already covered. What it should say is that any other Object is treated as a model attribute by default.