• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring can't find bean property in a list element.

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi with spring MVC 3.0.5 and jsp, I tried to treverse a List of beans, but it thrown the following exception:

...
02:15:53,992 ERROR [org.springframework.web.servlet.tags.form.LabelTag] (http--192.168.1.20-8080-3) Invalid property 'article' of bean class [LuxuryLiving.manager.pagebean.ProductBean]: Bean property 'article' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?: org.springframework.beans.NotReadablePropertyException: Invalid property 'article' of bean class [LuxuryLiving.manager.pagebean.ProductBean]: Bean property 'article' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:707) [spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:555) [spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:532) [spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
....




jsp code:



productbean class:



ProductArticleBean class:



I know the problem is in my jsp file, but I couldn't figured out how to correct the error.
Any suggestion is very appreciated.
Thanks
Sam
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like you have a typo somewhere. Not what I see, but somewhere, and might not be that loop in the jsp

"Invalid property 'article' of bean class [LuxuryLiving.manager.pagebean.ProductBean]: Bean property 'article'"

That says to me, somewhere you forgot an "s" in the name of the property, as ProductBean has "articles" but not "article" Do a text find in your jsp.

Mark
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I changed to something like this:



Is this correct? Now error is free, but I am not sure whether this will pick up the value from my backing bean (productbean).
thanks
Sam
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have added more codes to it, but error comes back.
Here is the code:



The error message is:

10:22:26,607 ERROR [org.springframework.web.servlet.tags.BindTag] (http--192.168.1.20-8080-8) Invalid property 'pf' of bean class [LuxuryLiving.manager.pagebean.ProductBean]: Bean property 'pf' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?: org.springframework.beans.NotReadablePropertyException: Invalid property 'pf' of bean class [LuxuryLiving.manager.pagebean.ProductBean]: Bean property 'pf' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:707) [spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:555) [spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:532) [spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:697) [spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:98) [spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:224) [spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.supp

 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic