Skip to content

Spring MVC DispatcherServlet initialization parameter contextClass in documentation should implement ConfigurableWebApplicationContext not WebApplicationContext [SPR-17414] #21947

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

Closed
spring-projects-issues opened this issue Oct 19, 2018 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Sun Tao opened SPR-17414 and commented

In section 22.2.3 table 22.2, the explanation for contextClass Paramter is "Class that implements WebApplicationContext ..."

Web MVC framework

But when I see the source code of FrameworkServlet, the method createWebApplicationContext will throw exception if  ConfigurableWebApplicationContext is not a super class of contextClass. So is it better to say contextClass should implement ConfigurableWebApplicationContext?

Thank you.


Affects: 4.3.18

Referenced from: commits 448182f, 1c67ef4, c9f1016

Backported to: 5.0.11, 4.3.21

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Indeed, with the default context loading algorithm in FrameworkServlet / DispatcherServlet, the context class needs to implement ConfigurableWebApplicationContext. Only with a custom subclass of DispatcherServlet, other kinds of WebApplicationContext could be used.

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.1.2 milestone Jan 11, 2019
This was referenced Jan 11, 2019
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) status: backported An issue that has been backported to maintenance branches type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants