wood burning stoves 2.0*
The moose likes JSP and the fly likes get table values from jsp to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "get table values from jsp to servlet" Watch "get table values from jsp to servlet" New topic
Author

get table values from jsp to servlet

gayatri umesh
Greenhorn

Joined: Aug 26, 2009
Posts: 17
//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.........
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
gayatri umesh
Greenhorn

Joined: Aug 26, 2009
Posts: 17
The value for that radio button should be the employee ID?
gayatri umesh
Greenhorn

Joined: Aug 26, 2009
Posts: 17
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

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

Joined: Aug 26, 2009
Posts: 17
ok.... i will try this..thanks....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: get table values from jsp to servlet
 
Similar Threads
how show values in jsp from getting database
Jsp Array Iteration
how to get form parameters data to a servlet?
get the value in a jsp page to the servlet
Transfer the variable value from one jsp page to other