Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting the status of a checkbox in a servlet

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am building an email-system with servlets and html
with functionalities line inbox,compose delete mail.

i am facing problem ,while implementing the delete functionality
The requirement for the delete functionality is that user should select the checkbox corresponding to a mail to be deleted and the after clicking the delete hyperlink should be able to see the inbox with only the left over mails.



The data in the second row onwards is inserted into html table dynamically by querying the mysql database table mailbox corresponding to logged in user.
The checkbox is not within a form and don't want to use either a javascript or button for the deletetion.



----------------------------------delete inbox compose logout-------------------
---------------------select subject sender date---------------------
------------------------------------------------- IMP m20 09-09-2011
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code seems to be generating HTML and updating the database all at once. Probably that's the source of your confusion. You should have two pieces of code: the first should generate the HTML, including a form containing the checkboxes, and the second should process the request generated by that form.
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Your code seems to be generating HTML and updating the database all at once. Probably that's the source of your confusion. You should have two pieces of code: the first should generate the HTML, including a form containing the checkboxes, and the second should process the request generated by that form.

i have deleted that portion from the code.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I can tell your problem is that you don't know what HTML you should generate. If that's the case, then showing us some Java code that allegedly generates some HTML is pretty useless. Let's talk about the HTML you need (and why you have the idea that you don't want to use an HTML form).

Okay? Post the HTML you think you need and let's start from there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic