• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how do I pass data from one JSP to another?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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").
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic