• 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

Getting multiple properties from jsp:usebean

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I though I remember reading that you can get nested properties in a java bean using the jsp:useBean tag.
For example, if I have a "Container" bean which contains a "Person" bean which then has a name property, I could retrieve it by using...
...
<jsp:getProperty name="Container" property="person.name"/>
...
This would then translate to
Container.getPerson().getName()
I could be totally wrong here. (Which would explain why I haven't seen any documentation on this) But if I am half right, could someone point me out to some documentation that illustrates this?
Regards,
Joshua
[ March 08, 2003: Message edited by: Joshua White ]
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correct me if I am wrong but I don't think the
getProperty tag is designed to work that way.
I believe the property element contained in the getProperty tag must relate to the name of a get method defined in your bean.
for example getProperty property="address" implies you have defined a method called getAddress() in your bean.
Also for example if you have setProperty property="*" will
assign all your setter methods based on your html
elements.
Craig
 
Joshua White
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Figured it out!
This was a STRUTS thing. Using the struts bean tags, you can access nested properties.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic