• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to post an array list of strings to a servlet  RSS feed

 
raja peter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to have a servlet which gets invoked from a java program and to submit an array list of strings as input using POST method.

ArrayList<String> slist = new ArrayList<String>(100);

I want the above list to be submitted to a servlet and to be stored in db.

I would like to have guidelines on both client and server parts.

Thanks.


 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using HttpClient API using this link HttpClient download the API from that site and read the docs and do your job..its having mechanisms through which you can communicate with a servlet from a java program..
just check this for sample code using httpclient ...postmethod example one more example HttppostmethodExample....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to serialize the array to a text format for transfer over HTTP. JSON or XML are customary.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!