我想在將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 –