How do I use jsp:forward after a user clicks a link? In other words, I want to pass the request object, received in my jsp file to another jsp file, only after the user has clicked (onclick event) in my jsp page. If I use jsp:forward in the onclick event the second jsp is automatically forwarded without displaying the first jsp file.
a href="#" onclick="window.open('URI?QueryString','NewWindow',
Thanks for help.
I wanted to use jsp:forward because I want to pass request object of the displayed jsp page (a.jsp), to the forwarded jsp page (b.jsp).
If I simply put onclick with href=b.jsp page on a.jsp, the b.jsp page gets displayed,yes, but it does not get the request object(parameters recvd with POST method) of a.jsp page.
I don't want to use querystring with b.jsp page as it is a long list of parameters that are being passed including a password field which gets displayed in the query string.
Is there any other way to pass request objects hopping from one jsp to another and so on until we stop.
storing your request object in the session object. of course you can just use the session object to directly store whatever values you are preserving, but that would involve a lot of casting and conversion.
so in jsp 1 you can say
and in jsp 2 you can say
// if you don't care about jsp2's implicit request object
request = (HttpServletRequest)session.getAttribute("request");
// if you want to preserve jsp2's implicit request object
HttpServletRequest request2 = (HttpServletRequest)session.getAttribute("request");
Now you can treat the new request object as it was in jsp1. Hope this works/helps!
This is guda.. I too also getting the same problem.
actualy i want to send values from first jsp page to second jsp page. HOW? I am using weblogic server.. is there any need to change in the weblogic properties file.. pls give me ur idea.. with a small example..(code).