Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to pass an array to servlet  RSS feed

 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have an array in client side (JavaScript var) which store the input from the client. How do I pass this array of data into servlet?
Please help,
Simon
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the input comes from a <form> just post the form like any other form. If there are parts not in a form, I think you could set "hidden" variables in the form.
This way everything will be handled by your doPost method.
Bill

------------------
author of:
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, William,
Thanks for your prompt reply.
In fact, I have a normal form with checkbox, list, and text, which should accept user's input for many times. And then finally submit to servlets. Is this possible? SHould I user var (in JavaScript) to store the input, and then accept second time's input.
Thank you for your help,
Simon
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!