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

Sending arraylist to servlet from jsp  RSS feed

 
sonu rai
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have 1 jsp with 2 form on it, from 1st form i am getting an arraylist on submit and i have to send that arraylist to servlet on the submit of second form.My problem is when i use setAttribute in jsp to set arraylist and getting it on servlet it gives null.

What can i do to solve this problem.

Regards
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the relevant code? The parts where you create the ArrayList, set it as an attribute and then read it back.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several scoped objects with setAttribute methods.
You didn't tell us which one you're using.

I'm guessing that you bound them to the request object since it was null in your next request. If your scoped variables need to last longer than one request, use session or application scope.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!