This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Posting a jquery array to JSP

Abhilash Chander
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using jquery on my front end for a shopping cart application. After the cart is filled, on pressing save button the data will be saved into the database through a JSP.

Below I built the array from my cart items using jquery :

Then I post my array from jquery to JSP page 'SaveOrderDetails.jsp' as shown below :

Below are the parameter names I am getting on the JSP page :


As they are individual parameters, how can I fetch them as a two dimensional array instead of individual parameters. Because count of array is going to vary with number of items added to the cart.

My attempt to fetch the array on JSP page :

Hope you guys can take some time to help. Thanks for your help in Advance.
Bear Bibeault
Author and ninkuma
Posts: 64629
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, Java code should be in a servlet, not a JSP.

Secondly, you might look into the commons beanutils project for help with converting complex params to beans and lists.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic