Help needed to hide the parameter list from the URL

Hi,

Currently in many places in our project we have used href in jsp to move to another page and to invoke another action class with input parameter. e.g.

<html:form action="/myAction">

...

...

<a href="<%=request.getContextPath()%>/myAction.do?param1=FirstName&param2=LastName/>">

...

</html:form>

when this hyperlink is clicked, on the next page this is shown in the address bar of the browser as:

http://localhost:9080/MyApp/myAction.do?param1=FirstName&param2=LastName

We need to hide the parameter list in the address bar of the browser. We have tried with a filter to convert the GET call to POST, but it didn't work.

Any help would be appreciated.

Thanks,

Jayant

[871 byte] By [jayantkdasa] at [2007-11-27 3:55:46]
# 1
An ordinary link is actually always a GET request. A link actually does NOT submit the parent form.Replace it by a POST form with hidden input fields for the values and a button.If you really want to do this using a link, then use the onclick to submit the actual form.
BalusCa at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi Balus,

Thanks for the reply. I could definitely understand the solution provided by you, and we do have kept this as one of the options. Actually I would like to explain to you, what I was trying to do.

We had implemented a Filter, where we were trying to convert the GET requests to POST by overriding the getMethod(). Although we were able to do so, but I don't have a proper understanding why didn't the URL change.

Your reply would be appreciated.

Thanks,

Jayant

jayantkdasa at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
because the request type changes on the server, AFTER the browser has submitted the data.
gimbal2a at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hi Gimbal,Thanks for the clarification.
jayantkdasa at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Well, we finally got the solution, though not very robust. We were able to remove the query string from the URL, by shifting the call made from the jsp to the action. The idea was to form the query string in a new ActionForward, which solved the problem.

Thanks all for your help.

Jayant

jayantkdasa at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
hey please post you soltion if u can and thanksbye
javaskilleda at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

> hey

> please post you soltion if u can

> and thanks

> bye

Hi,

The solution was as follows:

On the click of the link, submit the form from a javascript function call. Now in the action class, we did something like ...

return new ActionForward("/myAction.do?param1=xyz&param2=123");

I would like to add that in my perception this does not seem to be robust solution, but since we were handling a large area, hence we went for it.

Thanks,

Jayant

jayantkdasa at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
Enclosing your application inside a Frame will mask the URL into the address bar. This might help you rather than touching all the code. This will be really easy if you had used tiles framework. http://www.jguru.com/faq/view.jsp?EID=1035749
kalyan.indiana at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9

> Enclosing your application inside a Frame will mask

> the URL into the address bar. This might help you

> rather than touching all the code. This will be

> really easy if you had used tiles framework.

>

>

>

> http://www.jguru.com/faq/view.jsp?EID=1035749

Well we are indeed using a frame work, this problem was not related with this at all.

jayantkdasa at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
So you want to hide only the parameter list and not the URL. Because if you use the Frames inside HTML, the URL in the address bar will not change as frame submits the URL on its own. I thought this might help you to hide the values from the user.Hope my understanding is not wrong.
kalyan.indiana at 2007-7-12 8:59:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...