I want to hide the url when redirected to page on other server. For Eg : This is the index.jsp Page
我想在重定向到其他服务器上的页面时隐藏该URL。对于Eg:这是index.jsp页面
<body>
<form id="inset_form" >
<input type="submit" value="GO" onclick="func();">
</form>
</body>
When someone clicks on submit it will go to servlet.
当有人点击提交时,它将转到servlet。
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("Post");
response.sendRedirect("https://*.com/questions/14018215/what-is-url-pattern-in-web-xml-and-how-to-configure-servlet");
}
Now it will redirect to the page on another server
现在它将重定向到另一台服务器上的页面
https://*.com/questions/14018215/what-is-url-pattern-in-web-xml-and-how-to-configure-servlet
Now I want the url like this : https://*.com/questions/anotherPage
现在我想要这样的网址:https://*.com/questions/anotherPage
instead of
https://*.com/questions/14018215/what-is-url-pattern-in-web-xml-and-how-to-configure-servlet
but it should redirect to same page only with some information hidden.
但它应该重定向到同一页面,只隐藏一些信息。
If it is possible then please help.
如果有可能请帮忙。
Thanks in advance.
提前致谢。
2 个解决方案
#1
1
You'll want to use URL Rewrites: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
您将要使用URL重写:http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
#2
1
Unless you program your server to consider
除非您对服务器进行编程以考虑
page.com/way-to-long
To be the same as
和...一样
page.com/better
Then I'm not sure this is possible. It can't be done in pure JavaScript because editing the URL could lead to phishing scams (I could change my scam site's URL to facebook.com after the loading is done). Other people linked how to do it with Mod_rewrite on an Apache surver.
然后我不确定这是可能的。它不能在纯JavaScript中完成,因为编辑URL可能会导致网络钓鱼诈骗(我可以在加载完成后将我的骗局网站的URL更改为facebook.com)。其他人将如何使用Apache onver上的Mod_rewrite进行链接。
#1
1
You'll want to use URL Rewrites: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
您将要使用URL重写:http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
#2
1
Unless you program your server to consider
除非您对服务器进行编程以考虑
page.com/way-to-long
To be the same as
和...一样
page.com/better
Then I'm not sure this is possible. It can't be done in pure JavaScript because editing the URL could lead to phishing scams (I could change my scam site's URL to facebook.com after the loading is done). Other people linked how to do it with Mod_rewrite on an Apache surver.
然后我不确定这是可能的。它不能在纯JavaScript中完成,因为编辑URL可能会导致网络钓鱼诈骗(我可以在加载完成后将我的骗局网站的URL更改为facebook.com)。其他人将如何使用Apache onver上的Mod_rewrite进行链接。