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

Allow customizing DispatcherServlet in AbstractDispatcherServletInitializer [SPR-13222] #17813

spring-projects-issues opened this issue Jul 11, 2015 · 2 comments


Copy link

@spring-projects-issues spring-projects-issues commented Jul 11, 2015

Christian Rudolph opened SPR-13222 and commented

It would be nice if AbstractDispatcherServletInitializer#registerDispatcherServlet's default implementation would call a configuration hook for the registered dispatcher servlet.
This would allow to configure properties like throwExceptionIfNoHandlerFound and others that aren't easily accessible in a pure java config environment.

It could be implemented the same way as AbstractDispatcherServletInitializer#customizeRegistration: simply a protected method with the instance of the DispatcherServlet as its sole argument.

Affects: 4.2 RC2

Referenced from: commits d738ddd

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 13, 2015

Stéphane Nicoll commented

There is createDispatcherServlet hook point in that class that allows you to customize the DispatcherServlet (and even create a sub-class of it if you need to).

Could you please try this against 4.2.0.BUILD-SNAPSHOT (available in the next hour or so)? Thanks!

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 13, 2015

Christian Rudolph commented

I can confirm that it works as intended. The solution is even smarter than I initially imagined.
Great work!

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

Successfully merging a pull request may close this issue.

None yet
2 participants