It's always better to know what version of servlet container we are using and which version of JSP is compatible with that.
To know the version of servlet containr and JSP versions , you can use the following lines in JSP.
The JSP version usually goes hand in hand with the servlet version as follows:
Servlet Engine: <%=session.getServletContext().getMajorVersion()%>.<%=session.getServletContext().getMinorVersion()%> JSP Engine: <%=JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion()%> Application Server: <%=application.getServerInfo()%>
(OR)
Server info: <%= application.getServerInfo() %>
Servlet version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %>
JSP version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %>
Java version: <%= System.getProperty("java.version") %>
The actually used Servlet API version is to be found in the web.xml root declaration.The JSP version usually goes hand in hand with the servlet version as follows:
- Servlet 2.5 uses JSP 2.1
- Servlet 2.4 uses JSP 2.0
- Servlet 2.3 uses JSP 1.2
- Servlet 2.2 uses JSP 1.1
- Servlet 2.1 uses JSP 1.0
No comments:
Post a Comment