File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet and ajax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet and ajax" Watch "Servlet and ajax" New topic
Author

Servlet and ajax

Kapil Sankala
Greenhorn

Joined: Mar 30, 2011
Posts: 5
how should i retain checkbox value checked while returning from servlet.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

how is this related to Ajax?
Kapil Sankala
Greenhorn

Joined: Mar 30, 2011
Posts: 5
I will elaborate my question See i am calling function written in boilerplate from jsp page which is main page of our website then in boilerplate function i am making ajax call to servlet where i am firing sql query on database and record retrived are taken in json array which are back return to boilerplate where they are accessed in success function of ajax call.Now my problem is in success function of ajax whenever data is fetched from database i should get check box checked in short adding and updating information iwant to do from same form.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

So a page makes an ajax request and the response is received, but I am not sure where the problem is.
Kapil Sankala
Greenhorn

Joined: Mar 30, 2011
Posts: 5
My problem is in servlet and boilerplate.In servlet when i am getting value of particular field from database if that field value is yes then returning to boilerplate where checkbox is defined should get checked
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Ok
D. Ogranos
Ranch Hand

Joined: Feb 02, 2009
Posts: 214
Sounds like you just need Javascript to do that. You can probably simply set the checkbox in your success function (which is called when the Ajax call returns).
Kapil Sankala
Greenhorn

Joined: Mar 30, 2011
Posts: 5
Thanks for your solution it works
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet and ajax