I have this URL:
https://www.example.com/folder/New.jsp?par=new1
which I want to redir开发者_运维知识库ect to:
https://www.example.com/folder/New.jsp
how should I do that?
Basically, I have par=new1|new2|new3|new4
that would need to be redirected to https://www.example.com/folder/New.jsp
I did several attempts but those were not successful.
Well, at the start of New.jsp you can just do
<%
String par = request.getParameter("par");
if (null != par && par.matches("new[1-4]")) {
response.sendRedirect(request.getRequestURI());
return;
}
%>
精彩评论