-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Converters don't get picked up for MVC controllers in 3.0.7 [SPR-9157] #13795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Rossen Stoyanchev commented Added code formatting tags. |
Rossen Stoyanchev commented It would help speed things up if you could help demonstrate the issue at the spring-framework-issues repository. There are template projects to help you do that quickly. |
Ferenc Gratzer commented The sample project's created. However, the converter in this very little project without any security, interceptors etc. works fine. On Friday I debugged the startup of the application and the converters seemed to be registered properly in GenericConversionService. Any other idea where and what to look for to identify the cause of the issue? |
Chris Beams commented pull request: spring-attic/spring-framework-issues#19 |
Rossen Stoyanchev commented I would put a breakpoint in AnnotationMethodHandlerAdapter when it's about to process the request (e.g. in |
Ferenc Gratzer commented The demo for the issue is created. I think the issue is on the line 432 in GenericConversionService.ConverterAdapter: In my view it should be: If you compare the version of 3.0.6 and 3.0.7 of GenericConversionService, you'll see that those lines were only added in 3.0.7. |
Rossen Stoyanchev commented I see now. The converter is from String to Environment but the actual target object is a subtype of Environment. I think not allowing this is intentional since a Converter doesn't know what the actual target type expected is, it may return one that won't match. I I'll try to dig up the issue where this was change was made. |
Rossen Stoyanchev commented The issue where this was addressed is #13360. I guess you'll need to use GenericConverter for something like that or depending on your needs perhaps a ConverterFactory. |
Ferenc Gratzer opened SPR-9157 and commented
The same converter class and xml config work with Spring 3.0.5 and 3.0.6, but not with 3.0.7. Only changing the Spring version breaks it.
servlet.xml:
Log:
Affects: 3.0.7
The text was updated successfully, but these errors were encountered: