File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp:useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp:useBean" Watch "jsp:useBean" New topic


Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191

Can anyone gimme an example of how to use beanName attribute of the <jsp:useBean>tag and also whats the significance of it.

Radhika Jonnalagadda
Ranch Hand

Joined: Oct 13, 2004
Posts: 89
Hey Vineela,

This is an excerpt from JSP Spec.

<jsp:useBean id="name" scope="page|request|session|application" typeSpec />
typeSpec ::= class=�className� |
class=�className� type=�typeName� |
type=�typeName� class=�className� |
beanName=�beanName� type=�typeName� |
type=�typeName� beanName=�beanName� |
If the action has a body, it is of the form:
JavaServer Pages 2.0 Specification
<jsp:useBean id="name" scope="page|request|session|application" typeSpec >

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.

best regards,<br />Radhika<br /> <br />Dare to Dream.Care to Achieve.<br />SCJP 1.4, SCWCD 1.4.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 951

I addition :

The name of a bean, as excepted by the instantiate method of java.beans.Beans class.
beanName must be of the form a.b.c, which may be either a class, or the name of a resource of the form a/b/c.ser that will be resolved in the current ClassLoader.

That is the beanName find the class exaclty like the class attribute. or it can use the serialized object from the file system which haveextension .ser instead of class.


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
I agree. Here's the link:
subject: jsp:useBean
It's not a secret anymore!