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

Update documentation with regards to overrid RequestMappingHandlerMapping and RequestMappingHandlerAdapter when using the MVC namespace [SPR-9344] #13982

Closed
spring-projects-issues opened this issue Apr 25, 2012 · 3 comments

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Apr 25, 2012

Marek Sebera opened SPR-9344 and commented

When using mvc:annotation-driven automagic, there must be an option to override default beans of RequestMappingHandlerMapping and RequestMappingHandlerAdapter.

rstoyanchev/spring-mvc-31-demo#4 (comment)

On the link above, we fell to problem, that even if we instantiate our own subclass of RequestMappingHandlerMapping, and put it in right order, before the processing of default bean instance, we're not able to override it, nor configure it.
Which is causing problems for example to implement @RequestCondition.

In XML, there should be possibility to ref our own implementation of these beans:

  1. RequestMappingHandlerMapping
  2. RequestMappingHandlerAdapter
  3. ExceptionHandlerExceptionResolver

Not forcing us to use BeansPostProcessor, as an ugly solution to reconfigure default given beans.


Affects: 3.0 GA, 3.1.1

Referenced from: commits b3f0b6e

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Apr 26, 2012

Rossen Stoyanchev commented

Thanks for the suggestion. The key challenge is how to make this possible without introducing two (conflicting) ways of configuring the same thing. For example consider some of the options on mvc:annotation-driven:

<mvc:annotation-driven conversionService="myConversionService">
  <mvc:message-converters register-defaults="false">
    <bean class="org.springframework...MappingJacksonHttpMessageConverter"/>
  </mvc:message-converters>
</mvc:annotation-driven>

The conversionService reference and the message-converters are used to customize the created RequestMappingHandlerAdapter. If there was a way to also provide a reference to custom RequestMappingHandlerAdapter, it should be intuitive how it relates to the above configuration if both were present. I know we can say it's illegal to have both but that doesn't help with usability.

Suggestions are welcome!

Loading

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented May 18, 2012

Ulon commented

In any case the documentation http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestbody is at the moment misleading. It is driving many people into thinking that's the way to do it whether you use it mvc:annotation-driver or not.

I believe it should be updated with the above mvc:message-converters annotation

Loading

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented May 18, 2012

Rossen Stoyanchev commented

Ok I'll add links to examples with the MVC namespace and MVC java config there, which are further below in section 16.14.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants