Running .jsp as a .html file

I created a jsp page that works fine when executed in tomcat. But when I change my file extension to .html, it shows nothing. Is there a way I can run .jsp with the .html extension for files

+4
source share
2 answers

add

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

in web.xml

+7
source

The accepted answer did not help me. I got something working for a specific html page though (index.html)

  <servlet> <servlet-name>IndexServlet</servlet-name> <jsp-file>/index.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>IndexServlet</servlet-name> <url-pattern>/index.html</url-pattern> </servlet-mapping> 
0
source

Source: https://habr.com/ru/post/1396128/


All Articles