• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

How to get table values from JSP in servlet?  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table in my JSP page which dynamically adds rows. Could please help me to retrieve the values from JSP in servlet and store in DTO/Table(JDBC)
<table id="dataTable">


<TD><INPUT type="checkbox" name="chk" id="ck" onclick="checker(this)"/></TD>

<td >Select Stationery Items </td>

<td >

<select name="stationery">

<option selected disabled>Select Stationery Items</option>

<optgroup label="Pencils">

<option value="2B" >2B Pencil</option>

<option value="Era" >Erasers</option>

<option value="Mech" >Mechanical Pencil</option>

<option value="Refill" >Pencil Refill(0.05Mm)</option>


<optgroup label="Pens">

<option value="BB" >BallPoint Pen(Black)</option>

<option value="BBL" >BallPoint Pen(Blue)</option>

<option value="BR" >BallPoint Pen(Red)</option>

<option value="CP" >Correction Pens</option>

<option value="FPB" >Felt Pen(Black)</option>

<option value="FPBL" >Felt Pen(Blue)</option>

<option value="FPR" >Felt Pen(Red)</option>

<option value="PFWB" >Pen for WhiteBoard(Black)</option>

<option value="PFWBL" >Pen for WhiteBoard(Blue)</option>

<option value="PFWR" >Pen for WhiteBoard(Red)</option>

<option value="PHI" >Pen HighLighter</option>


<optgroup label="Stapler">

<option value="STREFILL3" >Stapler Refill for Max 3</option>

<option value="STREFILL10" >Stapler Refill for Max 10</option>

<option value="REMOVER" >Stapler Remover</option>

<option value="ST3" >Stapler using Max 3</option>

<option value="ST10" >Stapler using Max 10</option>




<td >Quantity </td>

<td><input type="text" name="qty"  placeholder="00" /></td>


<INPUT type="button" value="+" onclick="addRow('dataTable')" />



Saloon Keeper
Posts: 5288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since what you posted is HTML, not JSP, I'm assuming that you're talking about scraping a web site. The best Java library for that is HtmlUnit, IMO.
Ruth Stout was famous for gardening naked. Just like this tiny ad:
Become a Java guru with IntelliJ IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!