Proper exception for controller method return types that do not work with MvcUriComponentsBuilder (e.g. final classes) [SPR-16710] #21251
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Zhang Jie opened SPR-16710 and commented
I create Controller and test case as mvc-reference says:
Then I get error as follow:
After searching in the source code, I find that, MvcUriComponentsBuilder.on() will create proxy for return value of controll method using ControllerMethodInvocationInterceptor class, just as source says, but my controller method returns String, which's a final class, so cglib can't create subclass for it, then the error occurs.
Does MvcUriComponentsBuilder.on() have any restriction when work with controller method whicht return type is final class?
Affects: 4.3.16
Backported to: 4.3.17
The text was updated successfully, but these errors were encountered: