Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

beanName Attribute in useBean action  RSS feed

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i didn't get why the beanName attribute to be used.

when surfed the net i found the following answer.

"The name of a Bean as expected by the instantiate() method of the java.beans.Bean class"

still i didn't get what it meant by..
can any body explain me.

Thanks in Advance
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the JavaDocs for the java.beans.Beans class...

Basically the instantiate() method provides a way for code to dynamically load and use JavaBeans without knowing too much about them...

As for the beanName, the JavaDoc states (under the third instantantiate() method, the one with 4 parameters...) -


In Beans 1.0 the given name can indicate either a serialized object or a class. Other mechanisms may be added in the future. In beans 1.0 we first try to treat the beanName as a serialized object name then as a class name.

When using the beanName as a serialized object name we convert the given beanName to a resource pathname and add a trailing ".ser" suffix. We then try to load a serialized object from that resource.


So, basically, beanName either gives the full class name of the bean, or it gives the name of a file that holds a serialized bean.

(NEP - edited to correctly quote the JavaDoc.)
[ October 19, 2005: Message edited by: Nathan Pruett ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!