• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

get table values from jsp to servlet

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
//employeeMaintenance.jsp


This is my jsp which displays a table of values... Here, i choose one of the rows by selecting the radio button and click Update.. the control transfers to the servlet... I want to get the values of the fields displayed in the table in the jsp page(select, employeeID,first name, last name, phone number, auth level) in the servlet and display them in text boxes in another jsp page(editEmployee.jsp)...

//editEmployee.jsp


Kindly tell me a solution how to get the table values in the servlet.........
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

gayatri umesh wrote:I want to get the values of the fields displayed in the table in the jsp page(select, employeeID,first name, last name, phone number, auth level)


No you don't. What you really want is the primary key of the record do that you can get those fields from the database. You don't need to needless fetch them from the client.

For that, simply make the primary key the value of the radio button.
 
gayatri umesh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The value for that radio button should be the employee ID?
 
gayatri umesh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In employeeMaintenance.jsp, i gave


In servlet i gave,


Here when i print the value of obj, i get the value of employeeID of first record always...
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

gayatri umesh wrote:The value for that radio button should be the employee ID?



Yes. Otherwise, how can you hook up the data to the right record?
 
gayatri umesh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok.... i will try this..thanks....
 
I once met a man from Nantucket. He had a tiny ad
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic