aspose file tools*
The moose likes JSP and the fly likes how do I pass data from one JSP to another? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how do I pass data from one JSP to another?" Watch "how do I pass data from one JSP to another?" New topic
Author

how do I pass data from one JSP to another?

Rogelio Trist�n
Greenhorn

Joined: May 12, 2005
Posts: 4
hey, I'm having a problem passing this data to a new JSP.. maybe you guys can help me out. here is thesection of code that seeems to be troubling me...




this will display a table with a list of names from top to bottom.... then it has an "edit" button in the cell next to it.. great.. but what I want to happen is when you click the "edit" button it should go to a new .jsp page that will display the name, and display the details of the name, I think that requires a statement like select * from Student where Stud_Name = t2...

but how do I send the data off to a new .jsp file? ? Im having trouble getting that to happen... thanks
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You need to use some hidden input fields in your current page, and then in your new page you just do request.getParameter("param_name").
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

but how do I send the data off to a new .jsp file? ? Im having trouble getting that to happen... thanks

Put the SELECT * FROM ... query in the second page.

Page 1 gets the list of names (and possibly your primary key as a hidden field)
Page 2 gets the detail for the student selected in page 1.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how do I pass data from one JSP to another?