Skip to content
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

Handlermapping qualifier #267

Merged
merged 3 commits into from
Aug 21, 2017

Conversation

annarieger
Copy link
Member

The recently introduced controller EndpointDocController for endpoint to retrieve all request mappings as JSON (#265) contains no unique @Qualifier annotation for requestMappingHandlerMapping what can be conceivably fragile.

This MR introduces handlerMapping bean inside of archetype servlet XML file and adds the corresponding qualifier to the controller mentioned above.

Please review @chrismayer @terrestris/devs

<!-- Use the full path within the current servlet context to find an appropriate handler.
s. http://docs.spring.io/spring/docs/4.0.7.RELEASE/spring-framework-reference/htmlsingle/#mvc-handlermapping -->
<beans:bean id="handlerMapping" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<beans:property name="alwaysUseFullPath" value="true"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for the current archetype context?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be useful for the more complex projects using multiple controllers in its context, but you're right, for the archetype that would be enough to use default config (alwaysUseFullPath=false).

@@ -26,6 +26,7 @@
* method-level @RequestMapping annotations in @Controller classes.
*/
@Autowired
@Qualifier("handlerMapping")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the qualifier to something more meaningful, e.g. requestHandlerMapping.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed in 5c2d27e

@dnlkoch
Copy link
Member

dnlkoch commented Aug 21, 2017

Thanks! Please merge!

@annarieger
Copy link
Member Author

Thanks back, merging

@annarieger annarieger merged commit 4097f0f into terrestris:master Aug 21, 2017
@annarieger annarieger deleted the handlermapping-qualifier branch August 21, 2017 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants