Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet name in url. how to get rid?  RSS feed

 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I have a servlet which takes values from loing.jsp, if the user is found the page is forwarded to home.jsp. The problem is I am getting the servlet name in the url, which is unnecessary for me, due to that the user will know the servlet name also. So how can i get rid of that. Show me the easiest way, please.


Thanks and Regards.
Adeeb
 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By knowing the servlet name the user cannot do anything if original servlet name has mapped appropriately in web.xml file. Actually the mapped servlet name only will be displayed, if you have not configured then it would be a problem.
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K. He cant do anything. But when i am on home.jsp, it still show as Login(servlet name). I want to see the real path of jsp. Is that not possible???
 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That might be because you have called Servlet Login and in the Login you have forwarded request and response to the home.jsp

In the forward() your browser URL will never change.

Anyone correct me if I am wrong...

Thanks..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm still trying to understand what the problem is. What's the issue? Why is it a problem if the servlet mapping shows in the URL?
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not quite sure I fully understand the issue here... but in your web.xml you can change the url to servlet mapping, so you could change the url for each servlet to something else, if that is what you want.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!