I had nothing to do today, and suddenly I thought of a question, can I change the suffix for accessing JSP files to my own suffix? After some debugging, I finally succeeded. Hahaha. So happy.....
First, configure in WEB.XM
<servlet>
<servlet-name>testsuffix</servlet-name>
<servlet-class>mytest.TestSuffix</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testsuffix</servlet-name>
<url-pattern>*.br</url-pattern>
</servlet-mapping>
Just write the page redirection in SERVLET..
String uri = request.getRequestURI();
uri = uri.replaceFirst(".br", ".jsp");
RequestDispatcher rd = request.getRequestDispatcher(uri);
rd.forward(request, response);
Hahaha. You can access previous JSP files through *.br.