This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JSP and the fly likes passing parameters to JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "passing parameters to JSP page" Watch "passing parameters to JSP page" New topic

passing parameters to JSP page

gino jersey

Joined: May 24, 2005
Posts: 21
i have a jsp page (call it foo.jsp) which processes data from a form. in the form the user enters search criteria, and the jsp runs the query and displays the data.

i use request.getParameter in foo.jsp. ok
in foo.jsp, there are hyperlinks that link back to foo.jsp to run the query again but sort it differently.

how can I pass the session parameters back into foo.jsp so they are available in the "second call" of foo.jsp?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
You can pass parameters to JSP pages as part of the URL, e.g. "foo.jsp?sortOrder=bar&sortDirection=baz"
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

or as hidden parameters if you are submitting a form.

[Asking smart questions] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: passing parameters to JSP page
It's not a secret anymore!