RE: no getter method exception
Ah think I see your problem. Its not that you dont have a getter, its that you have too many! The bean introspection stuff gets funny about multiple getters and setters and often refuses to recognise the property :-( Afaik multiple getters and setters is agaisnt the JavaBean spec. If you ask me the spec is a damn pain in this regard, but thats the way it is. -Original Message- From: Michael Olszynski [mailto:[EMAIL PROTECTED]] Sent: Friday, December 20, 2002 20:13 To: 'Struts Users Mailing List' Subject: no getter method exception Hi I get a no getter method exception (stackTrace below) But I do have the getter method!!! This is my Formbean: public class TimeProofFormBean extends ActionForm { private Vector timeProofList = new Vector(); public Vector getTimeProofList() { System.out.println(getTimeProofList()); return this.timeProofList; } public void setTimeProofList( Vector v ) { System.out.println(setTimeProofList( Vector v )); this.timeProofList = v; } // getter for indexed property public Object getTimeProofList(int index) { System.out.println(public Object getTimeProofList(int index) +index); if (index = timeProofList.size()) return new TimeProofTableBean(); return timeProofList.get(index); } // setter for indexed property public void setTimeProofList(int index, Object value) { System.out.println(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); } } 13:06:10,823 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) -- Fehlerfreie Software wirkt weniger komplex und diskreditiert damit den Entwickler! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: no getter method exception
(Multiple getters and setters for the same property name I mean) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, December 20, 2002 20:22 To: Struts Users Mailing List Subject: RE: no getter method exception Ah think I see your problem. Its not that you dont have a getter, its that you have too many! The bean introspection stuff gets funny about multiple getters and setters and often refuses to recognise the property :-( Afaik multiple getters and setters is agaisnt the JavaBean spec. If you ask me the spec is a damn pain in this regard, but thats the way it is. -Original Message- From: Michael Olszynski [mailto:[EMAIL PROTECTED]] Sent: Friday, December 20, 2002 20:13 To: 'Struts Users Mailing List' Subject: no getter method exception Hi I get a no getter method exception (stackTrace below) But I do have the getter method!!! This is my Formbean: public class TimeProofFormBean extends ActionForm { private Vector timeProofList = new Vector(); public Vector getTimeProofList() { System.out.println(getTimeProofList()); return this.timeProofList; } public void setTimeProofList( Vector v ) { System.out.println(setTimeProofList( Vector v )); this.timeProofList = v; } // getter for indexed property public Object getTimeProofList(int index) { System.out.println(public Object getTimeProofList(int index) +index); if (index = timeProofList.size()) return new TimeProofTableBean(); return timeProofList.get(index); } // setter for indexed property public void setTimeProofList(int index, Object value) { System.out.println(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); } } 13:06:10,823 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) -- Fehlerfreie Software wirkt weniger komplex und diskreditiert damit den Entwickler! -- 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]
Re: no getter method exception
But how shall I make indexed getters and setters? A lot of guys told me that I do have to make indexed getters and setters in my formbean, otherwise I get an indexoutofboundsexception. (See my last 5 posts on benutils.populate) Do you have any idea how to solve this problem? Thanks a lot Michael -- Fehlerfreie Software wirkt weniger komplex und diskreditiert damit den Entwickler! - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, December 20, 2002 1:22 PM Subject: RE: no getter method exception Ah think I see your problem. Its not that you dont have a getter, its that you have too many! The bean introspection stuff gets funny about multiple getters and setters and often refuses to recognise the property :-( Afaik multiple getters and setters is agaisnt the JavaBean spec. If you ask me the spec is a damn pain in this regard, but thats the way it is. -Original Message- From: Michael Olszynski [mailto:[EMAIL PROTECTED]] Sent: Friday, December 20, 2002 20:13 To: 'Struts Users Mailing List' Subject: no getter method exception Hi I get a no getter method exception (stackTrace below) But I do have the getter method!!! This is my Formbean: public class TimeProofFormBean extends ActionForm { private Vector timeProofList = new Vector(); public Vector getTimeProofList() { System.out.println(getTimeProofList()); return this.timeProofList; } public void setTimeProofList( Vector v ) { System.out.println(setTimeProofList( Vector v )); this.timeProofList = v; } // getter for indexed property public Object getTimeProofList(int index) { System.out.println(public Object getTimeProofList(int index) +index); if (index = timeProofList.size()) return new TimeProofTableBean(); return timeProofList.get(index); } // setter for indexed property public void setTimeProofList(int index, Object value) { System.out.println(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); } } 13:06:10,823 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) -- Fehlerfreie Software wirkt weniger komplex und diskreditiert damit den Entwickler! -- 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]
RE: no getter method exception ?
Sorry. Read the JavaBeans specification. A JavaBeans property has only one type. It's unfortunate that it's not easy to diagnose mistakes in following the JavaBeans specification. You often get unintelligible errors like you got. -Original Message- From: Sash Sash [mailto:[EMAIL PROTECTED]] I have a form bean that has getter methods that return a string and setter methods that take a string. That all works great. I decided to add some setter methods (used in my action class) that accept an int as a parameter. As soon as I overloaded the original setter methods, i get the following exception: No getter method for property rounds of bean org.apache.struts.taglib.html.BEAN So before the change, there were two methods for this field in my form public void setRounds(String rounds) {...} public String getRounds() {...} Then I added: public void setRounds(int rounds) {...} and got the exception listed above. Why can't I do this? The reason I really want this is to be able to use PropertyUtils.copyProperties() to copy from my business beans to my display beans. Any suggestions? Thanks in advance!!! - Post your free ad now! Yahoo! Canada Personals -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: no getter method exception ?
That is the JavaBean specification, but depending on what you are doing you can always create a method named getIntRounds() setIntRounds( int i ) etc.. get the idea don't name the extra getters/setters the same name of the member. Then in bean write you can always call and it works nicely. I did something with this for amounts/currencys/ and formatting, all in one class without having to use utilities. Makes it very convient when its all in one object. b- --- On Fri 12/13, Karr, David wrote:From: Karr, David [mailto: [EMAIL PROTECTED]]To: [EMAIL PROTECTED]: Fri, 13 Dec 2002 10:25:37 -0800Subject: RE: no getter method exception ?Sorry. Read the JavaBeans specification. A JavaBeans property has onlyone type. It's unfortunate that it's not easy to diagnose mistakes infollowing the JavaBeans specification. You often get unintelligibleerrors like you got. -Original Message- From: Sash Sash [mailto:[EMAIL PROTECTED]] I have a form bean that has getter methods that return a string and setter methods that take a string. That all works great. I decided to add some setter methods (used in my action class) that accept an int as a parameter. As soon as I overloaded the original setter methods, i get the following exception: No getter method for property rounds of bean org.apache.struts.taglib.html.BEAN So before the change, there were two methods for this field in my formpublic void setRounds(String rounds) {...}public String getRounds() {...} Then I added: public void setRounds(int rounds) {...} and got the exception listed above. Why can't I do this? The reason I really want this is to be able to use PropertyUtils.copyProperties() to copy from my business beans to my display beans. Any suggestions? Thanks in advance!!! - Post your free ad now! Yahoo! Canada Personals --To unsubscribe, e-mail: For additional commands, e-mail: ___ Can a Web portal forever change your life? Win up to $25 Million on iWon - click here!