MvcUriComponentsBuilder.fromMethodCall breaks for controller with CharSequence return type #30210
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: regression
A bug that is also a regression
Milestone
I am currently trying to upgrade to upgrade to Spring 5.3.26 (from 5.3.26, via Spring Boot 2.7.10) and encounter an error when using MvcUriComponentsBuilder.fromMethodCall for a controller that returns CharSequence. I believe this error is caused by this change: #29913
Stacktrace
Our code
After change #29913 MvcUriComponentsBuilder uses the classloader of the return type (in our case CharSequence) which returns null which causes the issue above.
Workaround
It's possible to return ModelAndView instead of CharSequence to fix this issue.
The text was updated successfully, but these errors were encountered: