Hi Claus

I am getting following exception if I do indexed = true

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:508)
        at java.util.ArrayList.get(ArrayList.java:320)
        at 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:521)
        at 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
        at 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770)
        at 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
        at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
        at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
        at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
        at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at 
com.jpmorgan.ib.bcs.servlet.BCSActionServlet.doPost(BCSActionServlet.java:82)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
        at java.lang.Thread.run(Thread.java:536)



--------------------------------------------------------------------------------

Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.



-----Original Message-----
From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] 
Sent: Friday, 27 February 2004 10:48 PM
To: Struts Users Mailing List
Subject: SV: ArrayList in Form


Hi Shashank 

If I understand you correct, you want to modify the properties in an object within a 
Collection

Do like this:

<logic:iterate id="rows" name="theForm" property="rows" type="com.company.TheObject" >
        <html:text name="rows" property="firstName" indexed="true" />   
        <html:text name="rows" property="lastName" indexed="true" /> </logic:iterate>

There are 2 important things to remember:
 1. id attribute in the iterate tag MUST have the same name as the property attribute 
in the iterate tag (rows)  2. you have to set the attribute indexed to true ( 
indexed="true" ) 

Hope this wil help you

Med venlig hilsen

Claus Weng Madsen, Teamleder
TELMORE A/S
Carl Gustavsgade 3, 2630 Taastrup
Telefon 70218700, Mobil 30242875
www.telmore.dk 


-----Oprindelig meddelelse-----
Fra: Dixit, Shashank (Cognizant) [mailto:[EMAIL PROTECTED] 
Sendt: 27. februar 2004 10:17
Til: [EMAIL PROTECTED]
Emne: ArrayList in Form


Hello All

I have a ArrayList in the form which contains a CustomObject "TheROw". I iterate thr 
this arraylist to display it by <logic:iterate> as follows. This row will contain many 
fields such as rate or amount.

<logic:iterate id="currentRow" name="theForm" property="rows" 
type="com.custobj.TheRow" > \\ Display all rows </logic:iterate>


PROBLEM : When the form gets submitted with rate or amount changed I expect I will get 
ArrayList back by changed values. But No change happens in the values.

Does that mean that If one uses ArrayList in the form, it can be used for the purpose 
of display only. If User changes some value we will not get those changed values. 

Pls suggest solution or tell me if I am making some mistake over here.



Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. Any unauthorised review, use, disclosure, 
dissemination, forwarding, printing or copying of this email or any action taken in 
reliance on this e-mail is strictly prohibited and may be unlawful.
Visit us at http://www.cognizant.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to