..... and if I also change the type of my indexed getter like this: /** * getter for indexed property in myFoos */ public TimeProofTableBean getTimeProofList(int index) { if (index >= timeProofList.size()) return new TimeProofTableBean(); return (TimeProofTableBean) timeProofList.get(index); }
I get following error: 18:49:56,141 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:980) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProc essor.java:779) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:246) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:129 2) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) 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(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve .java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex the same error I had before! -- Fehlerfreie Software wirkt weniger komplex und diskreditiert damit den Entwickler! ----- Original Message ----- From: "Michael Olszynski" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, December 19, 2002 6:49 PM Subject: Re: beanutils.populate with formbeans and vectors > 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...... > > > > > > Thaks a lot, Michael > > > -- > > > > > > > > __________________________________________________ > > 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]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>