Change the file suffix of JSP

xiaoxiao2021-03-06  51

I have no sound today, I suddenly think of a problem, can I change the suffix of the JSP file to my suffix? After some of my debugging, I finally succeeded. Hahaha. very happy.....

First, configure it in web.xm

testsuffix mytest.testsuffix TestSuffix *. br

Write a page in the servlet to turn it ..

String Uri = Request.getRequesturi (); URI = Uri.ReplaceFirst (". Br", ".jsp"); RequestDispatcher Rd = Request.GetRequestDispatcher (URI); RD.Forward (Request, Response);

Hahaha. You can access the previous JSP file by * .br.

转载请注明原文地址:https://www.9cbs.com/read-82106.html

New Post(0)