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

in the bean:write tag, can "name" even refer to an attribute name, instead of a bean name ?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
n the documentation, the "name" inside a tag is mentioned to be the name of the bean whose property has to be printed. If the property isn't mentioned, the value of the bean itself is printed. But if I set an attribute in the Action class like :

and in the JSP say :

I get "hello" even though "dda" is not the name of any bean. Why does that happen ? And what is meant by "bean itself is printed" ? Is its object's hashcode rendered ?
 
Ranch Hand
Posts: 144
Oracle Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This belongs in the struts forum instead of JSP forum. According to the Struts Documentation

Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by property (if specified). If property is not specified, the value of this bean itself will be rendered


From quickly reading the documentation, the tag assumes that you are using an object that follows the java bean naming standard. It seems like the tag is suposed to use the name and property attributes (similar to the jsp:getProperty tag) to display the value of the a bean's property. It also sounds like in the absence of the property tag, it will print the object toString() method.
 
Daud Miyan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Thanks. I posted it in the Struts forum. Couldn't find Struts in the forums list though.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question more than once.
 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic