Home >Web Front-end >HTML Tutorial >jsp servlet filter jsp suffix_html/css_WEB-ITnose

jsp servlet filter jsp suffix_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:57:531118browse

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


Reply to the discussion (solution)

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn