Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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

 
Greenhorn
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">



<tr>

<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>



<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>

<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>

</optgroup>



</select>

</td>


<td >Quantity </td>

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



<td>



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



</td>

</tr>


</table>
 
Saloon Keeper
Posts: 5127
135
  • 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.
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!