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

Incorrect javadoc in SpringServletContainerInitializer [SPR-11364] #15990

Closed
spring-projects-issues opened this issue Jan 28, 2014 · 0 comments
Closed
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

Michał Politowski opened SPR-11364 and commented

The javadoc says

If a web application includes a WEB-INF/web.xml file, it is important to understand that neither this nor any other ServletContextInitializer will be processed unless the <web-app> element's version attribute is >= "3.0" and the xsi:schemaLocation for "http://java.sun.com/xml/ns/javaee" is set to "http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd".

but the thread around https://java.net/projects/servlet-spec/lists/users/archive/2012-05/message/1 explicitly states that the version in descriptor doesn't matter, and at least in Tomcat 7.0.50 (and probably since 7.0.29, which has the following in the changelog:

As per section 1.6.2 of the Servlet 3.0 specification and clarification from the Servlet Expert Group, the servlet specification version declared in web.xml no longer controls if Tomcat scans for annotations. Annotation scanning is now always performed - regardless of the version declared in web.xml - unless metadata complete is set to true.

) the initializer is used even with version="2.5" in web.xml.


Affects: 3.2.6, 4.0 GA

Reference URL: https://java.net/projects/servlet-spec/lists/users/archive/2012-05/message/1

Backported to: 3.2.7

@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 4.0.1 milestone 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