Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested Tag (in Form of Table ) :: not able to submit masterForm

 
poonam mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I'm facing Error IndexOutOfBoundsException... while submitting form...

few details regarding my code :


[1]


==>>[2]



==>>[3] in JSP, I added ItemDetails in Form of table




== Struts.xml



==>> in ActionClass



==>> Error Occurs



java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.apache.commons.beanutils.PropertyUtilsBean.get IndexedProperty(PropertyUtilsBean.java:433)
at org.apache.commons.beanutils.PropertyUtilsBean.get IndexedProperty(PropertyUtilsBean.java:340)
at org.apache.commons.beanutils.PropertyUtilsBean.get NestedProperty(PropertyUtilsBean.java:684)
at org.apache.commons.beanutils.PropertyUtilsBean.get Property(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.BeanUtilsBean.setProp erty(BeanUtilsBean.java:884)


Pl. help in.

Let me know if you required any other information.

Thanks in Advance.
 
Venkata Kumar
Ranch Hand
Posts: 110
Firefox Browser Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use code tags to post your code.

Please post your corresponding struts.xml contents and jsp contents.

 
poonam mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I did changes in my original post as per your comments.

Pl. have a look into.

Thanks in Advance.

Byeeee
 
Venkata Kumar
Ranch Hand
Posts: 110
Firefox Browser Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The action GRNAction scope is request. When the jsp is rendered the contents of arraylist are displayed. But when you submit the form the arraylist is reinitialized and becomes empty. To fix the issue you may change scope to session.
For more info see here



 
poonam mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir,

As per your suggestion, I change the scope to request.--> session. and it works fine.

But still facing a problem :

By clicking on ADD button, it only take 1-ROW of the Item Table. Not taking rest of the rows which I add dynamically.

For adding a Row dynamically, I used below script :



Thanks for suggesting such informative link. As I'm new to struts, can you pl. suggest such links/books, which helps to understand struts-hibernate in depth.

Thanks in Advance.
 
Venkata Kumar
Ranch Hand
Posts: 110
Firefox Browser Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post complete jsp file contents which may be useful to analyze the issue.
 
poonam mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for being delay in reply.

JSP Page :::

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic