我想在将URL重定向到其他服务器上的页面时隐藏该URL。 对于EG: 这是index.jsp页面如何隐藏地址栏中的Url?
<body>
<form id="inset_form" >
<input type="submit" value="GO" onclick="func();">
</form>
</body>
当有人点击提交就会去的servlet。
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("Post");
response.sendRedirect("https://stackoverflow.com/questions/14018215/what-is-url-pattern-in-web-xml-and-how-to-configure-servlet");
}
现在会重定向到页面另一台服务器上
https://stackoverflow.com/questions/14018215/what-is-url-pattern-in-web-xml-and-how-to-configure-servlet
现在我想这样的网址:中 https://stackoverflow.com/questions/anotherPage
代替
https://stackoverflow.com/questions/14018215/what-is-url-pattern-in-web-xml-and-how-to-configure-servlet
但应只有一些隐藏的信息才会重定向到同一页面。
如果可能的话请帮忙。
在此先感谢。
试图找到关于mod_rewrite的信息。不知道jsp如何完成,但你几乎可以改变URL –