Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URL in tomcat server  RSS feed

 
Shahid Kahn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to have just www.abcd.com in the browsers address bar instead of www.abcd.com?name=myname

How to achieve that in tomcat server?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37222
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
name=myName is just a parameter. What servlet is processing the request? Do you have the code for it?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why? Knowing exactly what you are trying to accomplish is an important factor in answering the question. (And hopefully it's not "security".)
 
Shahid Kahn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont want people see what is being passed from one page another. That's the reason.
 
Paul Clapham
Sheriff
Posts: 22471
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But that doesn't have anything to do with Tomcat. It's just the way that HTML works.

You could use the POST method rather than the GET method in your URL, but bear in mind that only prevents some people from seeing the parameter values. It's possible for anybody to see them as they are passed, you just can't look over somebody's shoulder at their browser and see the parameters in the address bar. Using POST rather than GET also causes other differences, so you should take some time to research what those two methods do.
 
Shahid Kahn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example:
While writing the a reply the coderanch url I see is www.coderance.com/forums/posts/reply/0/644254

Actually what I want is not to show full URL in the address bar. No matter what page I visit my address bar should have only www.coderanch.com
 
Tim Holloway
Bartender
Posts: 18704
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The address bar is exactly what its name say it is. It is the GUI control where you enter URLs. When you click a link or submit a form, the browser itself "types" the destination URL into the address bar control and "presses the return key" to submit it.

If you want a user-friendly title, that's what the web page title element is for - it sets the page title in the browser's title bar.

Don't even think you can play games with the address bar for "security" purposes. It doesn't/cannot work that way. You want security, use a proven, tested security system such as the one that comes standard with J2EE and with Tomcat. User-defined security systems are an oxymoron unless you happen to be a full-time trainer security engineer, not a developer who's been told, "I need this app by Thursday. And by the way, it needs to be secure". Same thing for the local shop genius who thinks he's designed something "clever" and declared it to be the site standard for security.

If you want to hide details, use FORM POST instead of GET.

The closest thing to what you say you need is what you see in JavaServer Faces. It's still more than just the base URL, but the serious details are being kept in the JSF context, not in the URL itself and the URL acts primarily as a session "handle". Mostly that just annoys people. And not just users.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!