Hello all, I'd like to know why the ServletContext.java file found in the Tomcat 6.0.16 or 6.0.18 source code seems to belong to the Servlet 2.4 specifications whereas Tomcat 6.0.x supports the Servlet 2.5 specifications:
In this file, we can read: /** * Returns the major version of the Java Servlet API that this * servlet container supports. All implementations that comply * with Version 2.4 must have this method * return the integer 2. * * @return 2 * */ public int getMajorVersion(); /** * Returns the minor version of the Servlet API that this * servlet container supports. All implementations that comply * with Version 2.4 must have this method * return the integer 4. * * @return 4 * */ public int getMinorVersion(); In the same way, if we click on the 'Servlet API Javadocs' link (The Servlet 2.5 API Javadocs) on the following page: http://tomcat.apache.org/tomcat-6.0-doc/index.html We can read in the ServletContext javadoc: int getMajorVersion() Returns the major version of the Java Servlet API that this servlet container supports. All implementations that comply with Version 2.4 must have this method return the integer 2. Returns: 2 int getMinorVersion() Returns the minor version of the Servlet API that this servlet container supports. All implementations that comply with Version 2.4 must have this method return the integer 4. Returns: 4 Above in the same page, we can find the javadoc of the getContextPath() method which was added in the Servlet 2.5 specifications. I think there is a mistake in both versions (source and javadoc) because when I put the following code in a test JSP running on Tomcat 6.0.16: Servlet Engine: <%= session.getServletContext().getMajorVersion() %>.<%= session.getServletContext().getMinorVersion() %><br/> JSP Engine: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %><br/> Application Server: <%= application.getServerInfo()%><br/> I get: Servlet Engine: 2.5 JSP Engine: 2.1 Application Server: Apache Tomcat/6.0.16 Thank you in advance for your answers. Laurent --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org