Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes Pass arraylist from Javascript to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Pass arraylist from Javascript to servlet" Watch "Pass arraylist from Javascript to servlet" New topic

Pass arraylist from Javascript to servlet

Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

I want to pass my arraylist to Servlet from my .jsp page which will eventually be sent to my database.

Any help with that...??
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12682
Assuming you mean from the client browser page (that it was generated by JSP does not matter) in a request to a servlet.

You could create a POST request with the array contents as one String per line in the body of the POST.


Java Resources at
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60071

It's not clear what you are asking as there is no such thing as an ArrayList in JavaScript.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Pass arraylist from Javascript to servlet
Similar Threads
ArrayList in http response.
Storing arraylist of hashmaps in session
calling servlet from java program and more
ArrayList seems to be not working
how to pass arraylist from jsp to java bean