• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

beanName Attribute in useBean action

 
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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • 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 ]
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic