wood burning stoves 2.0*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem while retriving data" Watch "Problem while retriving data" New topic
Author

Problem while retriving data

bharatyadav
Greenhorn

Joined: Jul 09, 2005
Posts: 18
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.

Thanks
Ishrayansh
moh sak
Ranch Hand

Joined: May 11, 2005
Posts: 78
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

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: http://aspose.com/file-tools
 
subject: Problem while retriving data