| Author |
Can somebody explain to me the beanName attribute?
|
alzamabar
Ranch Hand
Joined: Jul 24, 2002
Posts: 379
|
|
Hi, I found a question related to <jsp:useBean> attributes and one of the attributes was beanName. I looked at the specs and I found the following:
The name of a bean, as expected by the instantiate method of the java.beans.Beans class. This attribute can accept a request-time attribute expression as a value.
Does anyone know what does this mean?
|
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
|
 |
Colin Fletcher
Ranch Hand
Joined: Sep 10, 2004
Posts: 200
|
|
From The Java Boutique :
The beanName attribute of the <jsp:useBean> tag is used to instantiate serialized Beans rather than creating new instances from a class file. If the Bean doesn't exist in the scope, then the beanName attribute is passed on to java.beans.Bean.instantiate(), which will instantiate the Bean for the class loader. It first assumes that the name corresponds to a serialized Bean file (identified by the .ser extension) in which case it will bring it to life, but if it can't find or invoke the serialized Bean it will fall back to instantiating a new Bean from its class.
|
SCJP 1.4 SCWCD 1.4
|
 |
alzamabar
Ranch Hand
Joined: Jul 24, 2002
Posts: 379
|
|
|
Thank you. That was very useful.
|
 |
Colin Fletcher
Ranch Hand
Joined: Sep 10, 2004
Posts: 200
|
|
|
Your Welcome. :-)
|
 |
Durgaprasad Guduguntla
Ranch Hand
Joined: Oct 20, 2003
Posts: 99
|
|
Further you can use JSP Expression (<%=) for beanName attribute which is not possible with class attribute. You need to have both beanName and type attributes for jsp:useBean tag. Thanks, Durga
|
Thanks,<br />Durgaprasad<br />SCJP1.4, SCWCD1.4, SCBCD1.3,<br />SCEA
|
 |
Durgaprasad Guduguntla
Ranch Hand
Joined: Oct 20, 2003
Posts: 99
|
|
This linkexplains further. Thanks, Durga
|
 |
 |
|
|
subject: Can somebody explain to me the beanName attribute?
|
|
|