This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp:useBean" Watch "jsp:useBean" New topic
Author

jsp:useBean

Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
Hi,

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

Regards,
Vineela
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� |
type=�typeName�
If the action has a body, it is of the form:
1-104 STANDARD ACTIONS
JavaServer Pages 2.0 Specification
<jsp:useBean id="name" scope="page|request|session|application" typeSpec >
body
</jsp:useBean>


beanName
--------
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: 950
Hi,

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.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp:useBean
 
Similar Threads
jsp:useBean
Problem with jsp:useBean tag
Trouble with the term "Standard Action"
Using bean:define
(URGENT) Singletons and JSP pages