my Arraylist has got a variable size.
so, i've put in the required action declarations(in struts-config.xml), the
DynaActionForm in session scope, and it works!
thanks a lot richard for your help!
best regards,
charles.
Message original Sujet: Re: dynaActionForm,JSTL, and indexed
properties
Date: Thu, 4 Dec 2003 15:51:25 -0800 (PST)
De: Richard Yee <[EMAIL PROTECTED]>
Pour: Struts Users Mailing List <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Charles,
If you the size of the ArrayList is constant, you can
specify the form-property 'size' attribute and this
will fix your problem. Otherwise, you need to use
session scope to store the FormBean. The reason is
that Struts will not size the colRequetes ArrayList
when the form is submitted. If the form is in request
scope, it will already be sized for you.
-Richard
--- Charles GAY <[EMAIL PROTECTED]> wrote:
> hi all.
> i have in my DynaValidatorForm called entrantesForm,
> declared an ArrayList (called colRequetes) of
> RequeteTO objects.
> type="java.util.ArrayList" />
>
> in my jsp, i want to update some properties of
> RequeteTO, like 'typeRequete' with the
> html-tag(html-el taglib declared above) with the
> t tag.
>
>items="${entrantesForm.map.colRequetes}"
> var="enregistrement" varStatus="status">
>scope="page" />
>
>value="${enregistrement.id}" />
> />
> />
>property="typeRequete" indexed="true"
> value="${enregistrement.typeRequete}" >
>
>value="${enregistrement.typeRequete}" />
>
>
>value="${enregistrement.typeRequete}" />
>
>
>
>
>
>
> the jsp result is good.
>
> an extract of the html source producted by the jsp:
> action="/comsis/entrantes/EntrantesRequete.do">
>
>
>
>
>Nom de la requete
>Type dossier
>Type requete
>
>
>
>
> checked="checked" />
>s
>entrante
> size="1"> selected="selected">Publique
> Privée
>
>
>
>
>
>
>gbgh,gh
>entrante
> size="1">Publique
> selected="selected">Privée
>
>
>
>
>
>
> but, when i submit the form,
> the server says that:
> StandardWrapperValve[action]: "Servlet.service()"
> pour la servlet action a généré une exception
> javax.servlet.ServletException: BeanUtils.populate
> at
>
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
> 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
>
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)
>
>
> - Root Cause -
> java.lang.IndexOutOfBoundsException: Index: 0, Size:
> 0
> at
> java.util.ArrayList.RangeCheck(ArrayList.java:507)
> at java.util.ArrayList.get(ArrayList.java:324)
> at
>
org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:298)
> at
>
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:474)
> 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.apach