Click to See Complete Forum and Search --> : how to pass parameter from one jsp to another using window.open?


yu169409
09-15-2003, 09:16 AM
hi there
can anyone tell me how to pass parameters from one jsp to another using window.open?
i need to open a popup window and pass parameters to the popup window, i understand that i could create a parameter list like this :
window.open('xxx.jsp?yyy=value');
but is there any other way to pass parameter? i have a lot of parameters, so i wonder if document.form[].submit could help to pass them to the popup window. thanks for ur help.

Khalid Ali
09-15-2003, 09:37 AM
instead of using URL to append variable values to it anthen retrieve themont he second page,you should use
Sessions in JSP,they give you a great deal of flexibility and control.

if you must then
somepage.jsp?name=value&name=value"

format will work and ont he next page use
request.getPrameter("name")

yu169409
09-15-2003, 10:01 AM
thanks for the tip, but can u give an example of using session so i can get an idea what it is. thanks

Khalid Ali
09-15-2003, 10:29 AM
That will a bit beyond the scope of this forum how ever,
here is a very brief description

HttpSession can be found in this package

javax.servlet.http

to create a new sesssion

session.setAttribute("variable_name");

where "variable_name" could be a simple variable,
a collection
an array etc.
and then to retireve the data you do this
session.getAttribute("variable_name");

if you want to read more about it then go to

http://java.sun.com

yu169409
09-16-2003, 08:03 AM
thanks for ur help.