Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while retriving data

 
bharatyadav
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Iam working on jsp and servlets
In my jsp form my fields are

IDNumber
IndexName
Status(checkbox)
Comment

While retriving the values from the data base to the jsp page

Status field is not showing whether is it checked or not

please help me out
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean that you don't get the value of the checkbox in your servlet ?
If so, please post your HTML form and your getParameter()
 
Ishrayansh Nath
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think ,You might be missing ,Once you check it your code....

* Checkbox values returns boolean 0 (False) or 1(True).
* in Servlet u set that attribute.(req.setAttribute(key,value))
* in jsp u can use (key),get attribute value(what u r setting that in servlet).

It might be get Checkbox values.

Thanks
Ishrayansh
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

first thing you should do is to check if the value you get from the database is available in the jsp.

then you should check the value of it like this :




and in the checkBox you do the following :




doing this will check the checkBox regarding the value you get from the database. IF and ONLY IF the value you get from the database is available at the JSP side.
Hope this will help.

Regardes,
moh sak
 
bharatyadav
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry iam not able to send code besacuse it not supporting it.
even though i do like this


please send me that logic for mainly jsp 's
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic