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.
-
How to use jsp:forward with onclick event ? (5 messages)
- Posted by: Anil Kumar
- Posted on: March 22 2001 01:44 EST
Threaded Messages (5)
- How to use jsp:forward with onclick event ? by pop qiu on March 22 2001 04:12 EST
- How to use jsp:forward with onclick event ? by Anil Kumar on March 23 2001 01:59 EST
- How to use jsp:forward with onclick event ? by sandy hoang on March 23 2001 09:43 EST
-
How to use jsp:forward with onclick event ? by joseph yi on March 23 2001 07:09 EST
- How to send first jsp page parameters to second jsp page.? by vk guda on March 29 2001 02:23 EST
- How to use jsp:forward with onclick event ? by Anil Kumar on March 23 2001 01:59 EST
-
How to use jsp:forward with onclick event ?[ Go to top ]
- Posted by: pop qiu
- Posted on: March 22 2001 04:12 EST
- in response to Anil Kumar
a href="#" onclick="window.open('URI?QueryString','NewWindow',
'menubar=no,toolbar=no,location=no,directories=no,status=no,
scrollbars=1,resizable=1,width=600,height=400');" -
How to use jsp:forward with onclick event ?[ Go to top ]
- Posted by: Anil Kumar
- Posted on: March 23 2001 01:59 EST
- in response to pop qiu
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. -
How to use jsp:forward with onclick event ?[ Go to top ]
- Posted by: sandy hoang
- Posted on: March 23 2001 09:43 EST
- in response to Anil Kumar
You can use hidden fields inside a form in a.jsp to pass the parameters read from a.jsp to b.jsp and a javascript statement in Href to make this form submited when click on the link. Action attribute of the form in a.jsp refer to 'b.jsp'.
-
How to use jsp:forward with onclick event ?[ Go to top ]
- Posted by: joseph yi
- Posted on: March 23 2001 19:09 EST
- in response to Anil Kumar
Try:
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
session.setAttribute("request", request);
and in jsp 2 you can say
// if you don't care about jsp2's implicit request object
request = (HttpServletRequest)session.getAttribute("request");
or
// 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! -
How to send first jsp page parameters to second jsp page.?[ Go to top ]
- Posted by: vk guda
- Posted on: March 29 2001 02:23 EST
- in response to joseph yi
Hi,
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).
Thank you
guda.