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¶m2=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¶m2=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
# 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
# 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
# 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¶m2=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
# 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.