Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sending multiple records with same name to a Servlet  RSS feed

 
Ashish Kataria
Greenhorn
Posts: 14
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have a problem..
I have a form.jsp which lists some records from a database. The user can select N number of records by selecting the corresponding check box and Submit. Every checkbox has the row id as its value.
A Servlet receives these values and processes ONLY the selected ones.

Now, if i use request.getParameter("inputfieldname"), it will accept only one value.
So I am using request.getParameterValues("inputfieldname") and storing them into an array, but it is showing all rows on displaying the array.
I want to process only the selected ones

Please help me in this regard..
Thanks in advance

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only the selected checkboxes are submitted so there must be a problem with your code either on the server or client side.
 
Ashish Kataria
Greenhorn
Posts: 14
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Bear Bibeault,

Thank you so much for your reply. I resolved the problem, you were right..there was an error in my server side code. I had forgotten to set any value to my checkbox and that was the problem.

I guess it's just one of those days when we are "Super Stupid", and that's exactly what happened
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad that the issue is solved!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!