Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues
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

Activity

spring-projects-issues

spring-projects-issues commented on Oct 22, 2018

@spring-projects-issues
CollaboratorAuthor

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.

added
status: backportedAn issue that has been backported to maintenance branches
in: webIssues in web modules (web, webmvc, webflux, websocket)
on Jan 11, 2019
added this to the 5.1.2 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: taskA general task

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jhoeller@spring-projects-issues

      Issue actions

        Spring MVC DispatcherServlet initialization parameter contextClass in documentation should implement ConfigurableWebApplicationContext not WebApplicationContext [SPR-17414] · Issue #21947 · spring-projects/spring-framework