This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "passing parameters to JSP page" Watch "passing parameters to JSP page" New topic
Author

passing parameters to JSP page

gino jersey
Greenhorn

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?

thanks.
Ulf Dittmer
Marshal

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


Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

or as hidden parameters if you are submitting a form.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: passing parameters to JSP page
 
Similar Threads
Servlet-engine-to-servlet-engine passthrough (WebSphere Commerce to Tomcat)
Need Help with JSP & Servlet
Best Strategies of Passing output data to web tier
basic html ->JSP-> javabean-> database questions
Advice needed on how to connect to a database in JSP