Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do I pass data from one JSP to another?

 
Rogelio Trist´┐Żn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic