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

mvc namespace should support adding HandlerInterceptors [SPR-6352] #11018

Closed
spring-projects-issues opened this issue Nov 13, 2009 · 2 comments
Closed
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Scott Andrews opened SPR-6352 and commented

The mvc namespace currently configures the DefaultAnnotationHandlerMapping, but does not provide a way to register handler interceptors.

This functionality could be something like:

mvc:annotation-driven
mvc:interceptors
<bean class="com.example.MyHandlerInterceptorAdaptor1" />
<bean ref="interceptor2" />
...
</mvc:interceptors>
</mvc:annotation-driven>


Affects: 3.0 RC2

@spring-projects-issues
Copy link
Collaborator Author

Stefan Schmidt commented

Indeed, the ability to register listeners would be great. Also we would also like to be able to register a default handler:

<mvc:annotation-driven>
   <mvc:interceptors>
      <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="lang"/>
      <bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor" p:paramName="theme"/>
   </mvc:interceptors>
   <mvc:default-handler>
      <!-- If no @Controller match, map path to a view to render; e.g. the "/index" path would map to the view named "index" -->
      <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
   </mvc:default-handler>
</mvc:annotation-driven>

@spring-projects-issues
Copy link
Collaborator Author

Keith Donald commented

Added mvc:interceptors element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant