Hide or not show url value

F

francan

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:
http://mydomain/mysite.jsp

Here is how I am fetching the parameter:

The redirect from a non java page goes to a servlet:
package projectOne;
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;

public class ProjectServlet extends HttpServlet {
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
String myvalue = request.getParameter("myvalue");
request.setAttribute("myvalue", myvalue);
request.getRequestDispatcher("/mysite.jsp").forward
(request,response);
}

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}

}



I capture the value in the mysite.jsp and it works great but
unfortunately shows the value also in the url:
<%= request.getAttribute("myvalue") %>
 
D

Dave Miller

francan said:
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:
http://mydomain/mysite.jsp
Add a cookie and use response.sendRedirect();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top