I do it like this: <logic:iterate id="timeProofList" indexId="listIdx" name="timeProofForm" property="timeProofList"> <tr> <td> <html:text name="timeProofList" property="fromHour" indexed="true"/>: <html:text name="timeProofList" property="fromMinute" indexed="true"/> </td> </tr> </logic:iterate>
-- Fehlerfreie Software wirkt weniger komplex und diskreditiert damit den Entwickler! ----- Original Message ----- From: "Richard Yee" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, December 19, 2002 7:16 PM Subject: Re: beanutils.populate with formbeans and vectors > Michael, > How are you accessing the indexed property in the JSP? > > -Richard > > --- Michael Olszynski <[EMAIL PROTECTED]> wrote: > > Hi Richard, > > > > thanks again for your quick reply. I thought I need > > to subclass Vector, > > because I don´t save plain Strings in my Vector, I > > save Beans in it. So > > therefore I thought I need to have a polymorhism to > > save myself the work to > > write always indexed setters and getters . But > > anyway, I put the code you > > wrote me in my bean, and I still get errors. I give > > you a small snippet of > > my code (I tried to remove everything unnecessary) > > and I also attach the > > errormessage after the samplecode. I´d really > > appreciate if you could look > > at it for a short moment. Thanks a lot > > > > Take care Michael > > > > **************************************************** > > public class TimeProofFormBean extends ActionForm { > > > > private Vector timeProofList = new Vector(); > > > > public Vector getTimeProofList() { > > return this.timeProofList; > > } > > > > public void setTimeProofList( Vector v ) { > > this.timeProofList = v; > > } > > > > > > /** > > * getter for indexed property in myFoos > > */ > > public Object getTimeProofList(int index) { > > if (index >= timeProofList.size()) > > return new TimeProofTableBean(); > > return timeProofList.get(index); > > } > > > > /** > > * setter for indexed property in myFoos > > */ > > public void setTimeProofList(int index, Object > > value) { > > int size=timeProofList.size(); > > if (index >= size) { > > for(int i=size; i<=index; i++) { > > timeProofList.add(new > > TimeProofTableBean()); > > } > > } > > timeProofList.set(index,value); > > } > > > > > > } > > > ********************************************************** > > jsp page: > > <logic:iterate id="timeProofList" indexId="listIdx" > > name="timeProofForm" > > property="timeProofList"> > > <tr> > > <td> <html:text name="timeProofList" > > property="fromHour" size="2" > > maxlength="2" indexed="true"/>: > > <html:text name="timeProofList" > > property="fromMinute" size="2" > > maxlength="2" indexed="true"/> </td> > > </tr> > > </logic:iterate> > > > **************************************************************** > > > > 18:35:35,684 ERROR [Engine] > > ApplicationDispatcher[/Zeiterfassung_Applikation] Se > > rvlet.service() for servlet jsp threw exception > > org.apache.jasper.JasperException: No getter method > > for property > > timeProofList o > > f bean timeProofForm > > at > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper > > .java:248) > > at > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2 > > 89) > > at > > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) > > at > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp > > atcher.java:684) > > at > > > org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD > > ispatcher.java:575) > > at > > > org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis > > patcher.java:498) > > at > > > org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary > > .java:820) > > at > > > org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.jav > > a:395) > > at > > > org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:191) > > at > > > org.apache.jsp.template_jsp._jspx_meth_template_get_4(template_jsp.ja > > va:221) > > at > > > org.apache.jsp.template_jsp._jspx_meth_html_html_0(template_jsp.java: > > 118) > > at > > > org.apache.jsp.template_jsp._jspService(template_jsp.java:62) > > at > > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136) > > at > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper > > .java:204) > > at > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2 > > 89) > > at > > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) > > at > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp > > atcher.java:684) > > at > > > org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD > > ispatcher.java:575) > > at > > > org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis > > patcher.java:498) > > at > > > org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary > > .java:820) > > at > > > org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.jav > > -- > > Fehlerfreie Software wirkt weniger komplex und > > diskreditiert damit den > > Entwickler! > > ----- Original Message ----- > > From: "Richard Yee" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, December 19, 2002 6:11 PM > > Subject: Re: beanutils.populate with formbeans and > > vectors > > > > > > > Michael, > > > You need to put the methods that I sent in the > > > FormBean class and not your Vector subclass. You > > > really don't need to subclass the Vector. > > > > > > > > > ex. > > > > > > public class MyForm extends ActionForm > > > { > > > private Vector myFoos = new Vector(); > > > > > > /** > > > * getter for indexed property in myFoos > > > */ > > > public Object getFoo(int index) { > > > if (index >= myFoos.size()) > > > return ""; > > > return myFoos.get(index); > > > } > > > > > > /** > > > * setter for indexed property in myFoos > > > */ > > > public void setFoo(int index, Object value) { > > > int size=myFoos.size(); > > > if (index >= size) { > > > for(int i=size; i<=index; i++) { > > > myFoos.add(""); > > > } > > > } > > > myFoos.set(index,value); > > > } > > > > > > > > > } > > > > > > > > > -Richard > > > > > > > Does anybody have an idea, where this exception > > is > > > > from. I´m still working on it...... > > > === message truncated === > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>