aspose file tools*
The moose likes JSP and the fly likes Retrieving parameters from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Retrieving parameters from jsp" Watch "Retrieving parameters from jsp" New topic
Author

Retrieving parameters from jsp

Chandra shekar M
Ranch Hand

Joined: Dec 20, 2006
Posts: 135
Hi

Here is the scenario. JSP will send the request along with request parameters using httppost. the servlet will process the request and forward the request to another
JSP File.

To access the request parameters of first JSP in second JSP. I can put them as request attributes in the servlet and forward the request to second jsp.
now my question is, is there any way where we can directly access the request parameters of first JSP In the Second JSP with the above scenarion. where the request
is forwarded to second jsp by the servlet.

If we are using httpget. then we can do this by calling javax.servlet.http.forward.query_string attribute. But here i have a httppost so i need some thing like
javax.servlet.http.forward.parameter.

Is there any other way to get this done.

Thanks
Raja
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61232
    
  66

Yes. Because you forward the same request from the servlet to the JSP, all request information, including parameters are available.

Use the param EL built-in map to access the parameter values.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Chandra shekar M
Ranch Hand

Joined: Dec 20, 2006
Posts: 135
Hi

Thanks for the reply, here there was one mistake in the post. the servlet will send a new http request to another servlet present on other server which will intern forward the new request to the second JSP. i think in this case we cant fetch the parameters directly.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61232
    
  66

Well, of course not. That changes everything. You'll need to pass the values on the URL of the remote request.
 
 
subject: Retrieving parameters from jsp