• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Update table

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
I an new to jsp. i have a simple web app which performs some operations on a book database ( bookid, bookname, author,price as fields of a table).my problem is when i want to update a table,i put a checkbox on a side along with columns.
when i select any one of checkbox and clicks on a submit button it goes to update page.here i want to set the book id to check box and pass it to next page.

so my question is how can assign a variable in scriptlet to a name or id of a html check box.


Thank you
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firstly, scriptlets? In 2012? Please read this JspFaq entry. No scriptlets should be used in any JSP code written after 2002.

Secondly, what you should do first is to figure out what the HTML to represent your display should be. All JSP does is to help you generate the HTML. So figure out what the HTML should be first, then figure out how to use JSP (with the JSTL and EL, not scriptlets) to generate that HTML.
 
john Dalton
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my code.



In this i want to set the bid value to the property of the checkbox
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Step 1: refactor the JSP to remove the Java code. Database access should specifically never be done in the view.

You might find this article helpful.
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic