Home >Web Front-end >HTML Tutorial >jsp servlet filter jsp suffix_html/css_WEB-ITnose
I now have such a requirement: I want to change the suffix of all jsp pages to HTML or htm. Now I wrote a filter myself and changed jsp to html, but when forwarding the page, it will fail because XXXX.html does not exist in the project at all. How can I achieve the above filtering? I hope Niu Niu can give me some advice
Niu Niu guys, have you never encountered such a problem? Or I didn’t express it clearly enough:
If a website made with jsp wants to be encrypted into html, that is, the address bar displays .html form, or .htm, do not display it as .jsp, but it is actually implemented by jsp!
If there is a solution, I hope it can help.
Use URL rewriting
Reference: JSP URL rewriting-urlrewrite
Niu Niu, have you not encountered such a problem? Or I didn’t express it clearly enough:
If a website made with jsp wants to be encrypted into html, that is, the address bar displays .html form, or .htm, do not display it as .jsp, but it is actually implemented by jsp!
If there is a solution, I hope it can help.
Thank you, I have solved the problem using urlrewrite now
Using URL rewrite
Reference: JSP URL rewrite-urlrewrite
Niu Niu, have you never encountered such a problem? Or I didn’t express it clearly enough:
If a website made with jsp wants to be encrypted into html, that is, the address bar displays .html form, or .htm, do not display it as .jsp, but it is actually implemented by jsp!
If there is a solution, I hope it can help.
You’re welcome, I’m glad the problem has been solved
Thank you, I now use urlrewrite to solve the problem