File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Problem while retriving data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem while retriving data" Watch "Problem while retriving data" New topic

Problem while retriving data


Joined: Jul 09, 2005
Posts: 18
Iam working on jsp and servlets
In my jsp form my fields are


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é

Joined: Nov 24, 2005
Posts: 14688

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()

[My Blog]
All roads lead to JavaRanch
Ishrayansh Nath
Ranch Hand

Joined: Nov 05, 2004
Posts: 45
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.

moh sak
Ranch Hand

Joined: May 11, 2005
Posts: 78

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.

moh sak

Joined: Jul 09, 2005
Posts: 18
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
I agree. Here's the link:
subject: Problem while retriving data
It's not a secret anymore!