Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionForm in session scope

 
Shankar Narayana
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have ActionForm which has a variable of type ArrayList, and I am using the nested tags to iterate through the arraylist in the jsp. For each row there is a delete button which removes the object from the arraylist when clicked.

Prior to putting the scope="session" in the <action path=...> of the struts config file, i was not able to retrieve the value of the arraylist upon form submission. Now when the scope is session and when I delete/add the rows in some order, during this process sometime it throws the IndexOutOfBoundsException for the arraylist.

Actually when i see the length of the Arraylist in the jsp page before iterating it shows me the correct length, but i dont know why the <nested:iterete> tag is looking beyond the length.

I think it is something to do with the session, anybody has some clue





the jsp code



shankar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic