Organizational Research By

Surprising Reserch Topic

Question:What is < jsp:usebean >tag why it is used.



asked Sep 13, 2013 in JSP by anonymous
edited Sep 12, 2013
0 votes
33 views



Related Hot Questions

2 Answers

0 votes

 

JSP Syntax
        id="beanInstName" 
        scope="page | request | session | application" 
        
            class="package.class"    type="package.class" 
 
           
This tag is used to create a instance of java bean first of all it tries to find out the bean if bean instance already exist assign stores a reference to it in the variable. If we specified type, gives the Bean that type.otherwise instantiates it from the class we specify, storing a reference to it in the new variable.so jsp:usebean is simple way to create a java bean.
Example:
     
a element contains a element that sets property values in the Bean,we have element also to get the value from the bean.
 
Explanation of Attribute
 
 id="beanInstanceName"
A variable that identifies the Bean in the scope we specify. If the Bean has already been created by another element, the value of id must match the value of id used in the original element.
scope="page | request | session | application"
The scope in which the Bean exists and the variable named in id is available. The default value is page. The meanings of the different scopes are shown below:
page – we can use the Bean within the JSP page with the element
request – we can use the Bean from any JSP page processing the same request, until a JSP page sends a response to the client or forwards the request to another file.
session – we can use the Bean from any JSP page in the same session as the JSP page that created the Bean. The Bean exists across the entire session, and any page that participates in the session can use it..
application – we can use the Bean from any JSP page in the same application as the JSP page that created the Bean. The Bean exists across an entire JSP application, and any page in the application can use the Bean.
class="package.class"
Instantiates a Bean from a class, using the new keyword and the class constructor. The class must not be abstract and must have a public, no-argument constructor.
type="package.class"
If the Bean already exists in the scope, gives the Bean a data type other than the class from which it was instantiated. If you use type without class or beanName, no Bean is instantiated.

 

answered Sep 13, 2013 by anonymous
edited Sep 12, 2013
0 votes

 

JSP Syntax
        id="beanInstName" 
        scope="page | request | session | application" 
        
            class="package.class"    type="package.class" 
 
           
This tag is used to create a instance of java bean first of all it tries to find out the bean if bean instance already exist assign stores a reference to it in the variable. If we specified type, gives the Bean that type.otherwise instantiates it from the class we specify, storing a reference to it in the new variable.so jsp:usebean is simple way to create a java bean.
Example:
     
a element contains a element that sets property values in the Bean,we have element also to get the value from the bean.
 
Explanation of Attribute
 
 id="beanInstanceName"
A variable that identifies the Bean in the scope we specify. If the Bean has already been created by another element, the value of id must match the value of id used in the original element.
scope="page | request | session | application"
The scope in which the Bean exists and the variable named in id is available. The default value is page. The meanings of the different scopes are shown below:
page – we can use the Bean within the JSP page with the element
request – we can use the Bean from any JSP page processing the same request, until a JSP page sends a response to the client or forwards the request to another file.
session – we can use the Bean from any JSP page in the same session as the JSP page that created the Bean. The Bean exists across the entire session, and any page that participates in the session can use it..
application – we can use the Bean from any JSP page in the same application as the JSP page that created the Bean. The Bean exists across an entire JSP application, and any page in the application can use the Bean.
class="package.class"
Instantiates a Bean from a class, using the new keyword and the class constructor. The class must not be abstract and must have a public, no-argument constructor.
type="package.class"
If the Bean already exists in the scope, gives the Bean a data type other than the class from which it was instantiated. If you use type without class or beanName, no Bean is instantiated.

 

answered Sep 13, 2013 by anonymous
edited Sep 12, 2013

...