The moose likes Servlets and the fly likes parameter passing with href Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "parameter passing with href" Watch "parameter passing with href" New topic

parameter passing with href

varkala prabhakar
Ranch Hand

Joined: Sep 08, 2001
Posts: 54
Hi all,
I my work, i get the url from the database and this is to be displayed as a link.I am using href for the link. When i click on the url, url parameters are displayed.
I cannot keep a submit button for the link to hide the parameters.
I want to hide the parameters, Can any one tell me how to hide the parameters.
thank you..
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Not sure if I'm getting your question straight or not, but here's a shot:
You want to create a link that will submit a request complete with request parameters, but do not want to display those parameters as part of the URL.
If so, I'd create a form with all the parameters that you want to submit as hidden values. This form would have no page-visibile components. Then, when the link is clicked, you submit the form via JavaScript (no submit button necessary).
For example:

[ March 25, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
You can create a form with hidden variables and use the POST method so the variables will not appear in the URL. Naturally you will have to handle the request in doPost. Any basic HTML reference will tell you how to create a form.
varkala prabhakar
Ranch Hand

Joined: Sep 08, 2001
Posts: 54
Hi William,
Whether Form can be handled with out a submit button.
I should not have a submit button, Just a link and parameters should be hidden
Hi Bear Bibeault, I will check with your function.
I agree. Here's the link:
subject: parameter passing with href
It's not a secret anymore!