Re: No getter method for property p of bean b - getP is public in b's super class
Assure the type of the object inside the searched contexts. Don't you have differents attributes (with distincts classes) in each context: A bean in page scope, a different one in request scope, another in session scope, and so on ? Try to use scope attribute when using ... --- [EMAIL PROTECTED] escreveu: > Hi Daniel - I am sure I am using the latest classes. > > Also I have tested what you suggested. If I only put > in > > getDealNumber <%=b.getDealNumber%> > > I can see the property value displayed properly. But > if I use bean:write, > then the same error happens. > > __ Yahoo! Messenger - Fale com seus amigos online. Instale agora! http://br.download.yahoo.com/messenger/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No getter method for property p of bean b - getP is public in b's super class
After i checked the taglib class i found this: ** START // Call the indexed getter method if there is one if (descriptor instanceof IndexedPropertyDescriptor) { Method readMethod =((IndexedPropertyDescriptor) descriptor). getIndexedReadMethod(); if (readMethod != null) { Object subscript[] = new Object[1]; subscript[0] = new Integer(index); return (readMethod.invoke(bean, subscript)); } } // Otherwise, the underlying property must be an array Method readMethod = getReadMethod(descriptor); if (readMethod == null) throw new NoSuchMethodException("Property '" + name + "' has no getter method"); // Call the property getter and return the value Object value = readMethod.invoke(bean, new Object[0]); if (!value.getClass().isArray()) throw new IllegalArgumentException("Property '" + name + "' is not indexed"); return (Array.get(value, index)); * END*** It shows that the taglib will read the property of and check set/get method in your related ActionForm. If not it will check if its an Array, if still not it throws NoSuchMethodException("Property '" + name + "' has no getter method"); I didnt see it checks if your ActionForm has parent or not. it just check the ActionForm itself. But still i am not 100% sure coz the code line is too long for a late night. You may check by your self. = == thx, a Java Student __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No getter method for property p of bean b - getP is public in b's super class
Yes, I have getter in the parent: public String getDealNumber() { return dealNumber; } XU CHENG EXT: 8476 DID: (65) 68898476 JavaSoft <[EMAIL PROTECTED]To: Struts Users Mailing List <[EMAIL PROTECTED]> .com>cc: Subject: Re: No getter method for property p of bean b - getP is public in b's super 04/22/2004 06:56 class PM Please respond to "Struts Users Mailing List" I am sorry i read your question wrong.. i thought you directly accessed the parent attribute. *duh* Check if you have getter that return something in the parent. --- [EMAIL PROTECTED] wrote: > > Thanks. Just to confirm - you mean use a public > getter method does not > help? This is due to reflection? or Java Beans > property? > > XU CHENG > EXT: 8476 > DID: (65) 68898476 > > > > > > > JavaSoft > > > <[EMAIL PROTECTED]To: > Struts Users Mailing List > <[EMAIL PROTECTED]> > .com>cc: > > > > Subject: Re: No getter method for property p of > bean b - getP is public in b's super > 04/22/2004 05:52 > class > > PM > > > Please respond to > > > "Struts Users > > > Mailing List" > > > > > > > > > > > > > private attribute doesnt inherit to any child. Use > protected or higher level. > > --- [EMAIL PROTECTED] wrote: > > I have a bean class B, whose super class is A. > > dealNumber is defined as private String in A, and > it > > has the following > > getter/setter > > public String getDealNumber() { > > return dealNumber; > > } > > > > public void setDealNumber(String dealNumber) { > > this.dealNumber = dealNumber; > > } > > > > Can this property be seen in if I use > > it to write properties > > of an object b of class B? > > > > In my JSP I set an instance of b to page context: > > pageContext.setAttribute("CURR_TXN", b); > > > > Then I do: > > > scope="page"/> > > > > But I got this error: No getter method for > property > > dealNumber of bean > > CURR_TXN > > > > I then tried to add this into B: > > public String getDealNumber() { > > return super.getDealNumber(); > > } > > > > And then the error is gone... can anyone help to > > explain why? > > > > Thanks. > > > > XU CHENG > > > > > > > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > = > == > thx, > a Java Student > > > > > __ > Do you Yahoo!? > Yahoo! Photos: High-quality 4x6 digital prints for > 25¢ > http://photos.yahoo.com/ph/print_splash > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > = == thx, a Java Student __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT
Re: No getter method for property p of bean b - getP is public in b's super class
I am sorry i read your question wrong.. i thought you directly accessed the parent attribute. *duh* Check if you have getter that return something in the parent. --- [EMAIL PROTECTED] wrote: > > Thanks. Just to confirm - you mean use a public > getter method does not > help? This is due to reflection? or Java Beans > property? > > XU CHENG > EXT: 8476 > DID: (65) 68898476 > > > > > > > JavaSoft > > > <[EMAIL PROTECTED]To: > Struts Users Mailing List > <[EMAIL PROTECTED]> > .com>cc: > > > > Subject: Re: No getter method for property p of > bean b - getP is public in b's super > 04/22/2004 05:52 > class > > PM > > > Please respond to > > > "Struts Users > > > Mailing List" > > > > > > > > > > > > > private attribute doesnt inherit to any child. Use > protected or higher level. > > --- [EMAIL PROTECTED] wrote: > > I have a bean class B, whose super class is A. > > dealNumber is defined as private String in A, and > it > > has the following > > getter/setter > > public String getDealNumber() { > > return dealNumber; > > } > > > > public void setDealNumber(String dealNumber) { > > this.dealNumber = dealNumber; > > } > > > > Can this property be seen in if I use > > it to write properties > > of an object b of class B? > > > > In my JSP I set an instance of b to page context: > > pageContext.setAttribute("CURR_TXN", b); > > > > Then I do: > > > scope="page"/> > > > > But I got this error: No getter method for > property > > dealNumber of bean > > CURR_TXN > > > > I then tried to add this into B: > > public String getDealNumber() { > > return super.getDealNumber(); > > } > > > > And then the error is gone... can anyone help to > > explain why? > > > > Thanks. > > > > XU CHENG > > > > > > > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > = > == > thx, > a Java Student > > > > > __ > Do you Yahoo!? > Yahoo! Photos: High-quality 4x6 digital prints for > 25¢ > http://photos.yahoo.com/ph/print_splash > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > = == thx, a Java Student __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No getter method for property p of bean b - getP is public in b's super class
Hi Daniel - I am sure I am using the latest classes. Also I have tested what you suggested. If I only put in getDealNumber <%=b.getDealNumber%> I can see the property value displayed properly. But if I use bean:write, then the same error happens. To JavaSoft - I changed all attributes to protected, but still got the same error... You wrote: Are you sure that you using the up-to-date version of your class ? Maybe a misspelled method name or attribute name ? Try to make this test (in your .jsp): <% B b = new B(); %> getDealNumber <%=b.getDealNumber%> <% pageContext.setAttribute("currTxn",b, PageContext.REQUEST_SCOPE); %> getDealNumber [EMAIL PROTECTED] wrote: >I have a bean class B, whose super class is A. >dealNumber is defined as private String in A, and it has the following >getter/setter > public String getDealNumber() { > return dealNumber; > } > > public void setDealNumber(String dealNumber) { > this.dealNumber = dealNumber; > } > >Can this property be seen in if I use it to write properties >of an object b of class B? > >In my JSP I set an instance of b to page context: >pageContext.setAttribute("CURR_TXN", b); > >Then I do: > > >But I got this error: No getter method for property dealNumber of bean >CURR_TXN > >I then tried to add this into B: > public String getDealNumber() { > return super.getDealNumber(); > } > >And then the error is gone... can anyone help to explain why? > >Thanks. > >XU CHENG > > > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No getter method for property p of bean b - getP is public in b's super class
Are you sure that you using the up-to-date version of your class ? Maybe a misspelled method name or attribute name ? Try to make this test (in your .jsp): <% B b = new B(); %> getDealNumber <%=b.getDealNumber%> <% pageContext.setAttribute("currTxn",b, PageContext.REQUEST_SCOPE); %> getDealNumber [EMAIL PROTECTED] wrote: I have a bean class B, whose super class is A. dealNumber is defined as private String in A, and it has the following getter/setter public String getDealNumber() { return dealNumber; } public void setDealNumber(String dealNumber) { this.dealNumber = dealNumber; } Can this property be seen in if I use it to write properties of an object b of class B? In my JSP I set an instance of b to page context: pageContext.setAttribute("CURR_TXN", b); Then I do: But I got this error: No getter method for property dealNumber of bean CURR_TXN I then tried to add this into B: public String getDealNumber() { return super.getDealNumber(); } And then the error is gone... can anyone help to explain why? Thanks. XU CHENG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No getter method for property p of bean b - getP is public in b's super class
Thanks. Just to confirm - you mean use a public getter method does not help? This is due to reflection? or Java Beans property? XU CHENG EXT: 8476 DID: (65) 68898476 JavaSoft <[EMAIL PROTECTED]To: Struts Users Mailing List <[EMAIL PROTECTED]> .com>cc: Subject: Re: No getter method for property p of bean b - getP is public in b's super 04/22/2004 05:52 class PM Please respond to "Struts Users Mailing List" private attribute doesnt inherit to any child. Use protected or higher level. --- [EMAIL PROTECTED] wrote: > I have a bean class B, whose super class is A. > dealNumber is defined as private String in A, and it > has the following > getter/setter > public String getDealNumber() { > return dealNumber; > } > > public void setDealNumber(String dealNumber) { > this.dealNumber = dealNumber; > } > > Can this property be seen in if I use > it to write properties > of an object b of class B? > > In my JSP I set an instance of b to page context: > pageContext.setAttribute("CURR_TXN", b); > > Then I do: > scope="page"/> > > But I got this error: No getter method for property > dealNumber of bean > CURR_TXN > > I then tried to add this into B: > public String getDealNumber() { > return super.getDealNumber(); > } > > And then the error is gone... can anyone help to > explain why? > > Thanks. > > XU CHENG > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > = == thx, a Java Student __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No getter method for property p of bean b - getP is public in b's super class
private attribute doesnt inherit to any child. Use protected or higher level. --- [EMAIL PROTECTED] wrote: > I have a bean class B, whose super class is A. > dealNumber is defined as private String in A, and it > has the following > getter/setter > public String getDealNumber() { > return dealNumber; > } > > public void setDealNumber(String dealNumber) { > this.dealNumber = dealNumber; > } > > Can this property be seen in if I use > it to write properties > of an object b of class B? > > In my JSP I set an instance of b to page context: > pageContext.setAttribute("CURR_TXN", b); > > Then I do: > scope="page"/> > > But I got this error: No getter method for property > dealNumber of bean > CURR_TXN > > I then tried to add this into B: > public String getDealNumber() { > return super.getDealNumber(); > } > > And then the error is gone... can anyone help to > explain why? > > Thanks. > > XU CHENG > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > = == thx, a Java Student __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
No getter method for property p of bean b - getP is public in b's super class
I have a bean class B, whose super class is A. dealNumber is defined as private String in A, and it has the following getter/setter public String getDealNumber() { return dealNumber; } public void setDealNumber(String dealNumber) { this.dealNumber = dealNumber; } Can this property be seen in if I use it to write properties of an object b of class B? In my JSP I set an instance of b to page context: pageContext.setAttribute("CURR_TXN", b); Then I do: But I got this error: No getter method for property dealNumber of bean CURR_TXN I then tried to add this into B: public String getDealNumber() { return super.getDealNumber(); } And then the error is gone... can anyone help to explain why? Thanks. XU CHENG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]