Tomcat JSP pages are handled by a special servlet designed to handle all requests ending with .jsp
or .jspx
in an HTTP request. This configuration exists in the global file $CATALINA\conf\web.xml
, where the following significant lines can be found. Please note that for Tomcat 6.
JSP Servlet Registration
<servlet> <servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> <init-param> <param-name>fork</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>xpoweredBy</param-name> <param-value>false</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet>
Display JSP Servlet URL
<servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jspx</url-pattern> </servlet-mapping>
Perhaps you can add more URL mappings for other file extensions that are not yet mapped to other servlets to run the Jasper compiler, which is ultimately responsible for translating the JSP files into the corresponding Java servlets, which are then compiled (using Eclipse JDT compiler by default). For more information on setting certain parameters in the process, see Tomcat's Jasper documentation .
source share