I have a JSP web page that is redirected from another non Java web site where I fetch the parameter from the non Java web site and put it in the JSP web page. It works great but the value shows up in my JSP url on Tomcat 6.0.18 located on a Windows server.
The problem is I dont want the parameter value showing up in the url.
The redirected parameter value shows in my JSP url like this: http://mydomain/mysite.jsp?myvalue=jones I want to hide or not show the myvalue=jones part of the url so it shows up like this:
John Plaer wrote:
There is a workaround if you are really desperate
1. Store the myvalue in session instead of request
2. Use response.sendRedirect instead of Dispatcher.forward
3. Retrive the value in jsp from session instead of request
This might not be a good practice but should resolve your issue.
He's already stated that the source is a non-java page. How is it going to obtain access to the session? the dispatcher?
Joined: Apr 09, 2009
I have a JSP web page that is redirected from another non Java web site where I fetch the parameter from the non Java web site and put it in the JSP web page.
Here is how I am fetching the parameter:
The redirect from a non java page goes to a servlet:
From the above lines by Nick and by looking at the servlet code it is quite obvious that the external website is pointing towards a servlet in which Nick is getting the url parameter and setting it in request context and dispatching to the locally placed mysite.jsp
Which has nothing to do with the fact that the external site is putting the request param on the URL.
There is nothing that can be done short of changing the external site to prevent that.
Joined: Apr 09, 2009
I totally agree with you that if the external site is putting the parameter in the url and when we get the control its already there in the url and nothing can be done with that.
my point is that the external site here (in this specific scenario) is not directly redirecting to the jsp. The external non java site is pointing to the ProjectServlet, as in http://mydomain/ProjectServlet?myvalue=abc and then this ProjectServlet dispatches the request to the mysite.jsp.