Can Tomcat be configured to interpret all, or selected, .html files within a given context as JSP? Or, do JSP files have to end with a .jsp extension?
Created May 4, 2012
swarraj kulkarni yes you can do that by modifying the web.xml file. You will have to invoke the org.apache.jasper.runtime.JspServlet
for all the requests having extension .html. You can do that by changing the Servlet mapping code:
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url>*.html</url>
</servlet-mapping>
And comment out the following block
<mime-mapping>
<extension>
html
</extension>
<mime-type>
text/html
</mime-type>
</mime-mapping>
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url>*.html</url>
</servlet-mapping>
And comment out the following block
<mime-mapping>
<extension>
html
</extension>
<mime-type>
text/html
</mime-type>
</mime-mapping>