How to pass requested parameter to another jsp ?
5 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nilesh_Shrestha
Posted On:   Tuesday, March 12, 2002 11:35 PM

I have taken parameters of a form from a jsp. I need to pass that parameters to another jsp. How can I do it without writing that manually using string like another.jsp?name=value. Since there are many paramters, passing through URL is inconvenient.Is there a way to do it ?
Thanx

Re: How to pass requested parameter to another jsp ?

Posted By:   Tagir_Sharipov  
Posted On:   Wednesday, March 13, 2002 08:28 PM

You also can put the form in your first jsp and specify another jsp as an action of this form. And after that just submit this form via Javascript.

Re: How to pass requested parameter to another jsp ?

Posted By:   Eelco_Cramer  
Posted On:   Wednesday, March 13, 2002 03:22 AM

request.getQueryString() gets you the whole query string. You can add that to a new query.

Re: How to pass requested parameter to another jsp ?

Posted By:   Anonymous  
Posted On:   Wednesday, March 13, 2002 01:05 AM

With the and tags you can also pass parameters using the tag:

...



...


Regards

Re: How to pass requested parameter to another jsp ?

Posted By:   Fabian_Wein  
Posted On:   Wednesday, March 13, 2002 12:50 AM

jsp:forward also forwards all parameters

Re: How to pass requested parameter to another jsp ?

Posted By:   Vladislav_Kamensky  
Posted On:   Tuesday, March 12, 2002 11:59 PM

There are tree ways to do it.

request.setAttribute("name","value");

session.setAttribute("name","value");

application.setAttribute("name","val");

I think for situation you have described, the request object will be appropriate for passing parameters.

Note:
Submitted parameters of your form are sending to next jsp by default and they are accesible through
request.getParameter("name");

About | Sitemap | Contact