Using .html files as JSPs

With 2 simple steps you can achieve this:

  1. Add this servletmapping for the JSP servlet:

    <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>
    

    This tells the application container to use the the JSP servlet when serving html files.

  2. Comment out the <mime-mapping> for text/html mime type (*.html) files so that the container won’t handle HTML files as static content.

Hope this helps.

Leave a Comment