<jsp:useBean> tag and it’s properties?

To separate the code from the presentation it would be good idea to encapsulate the code in java object instantiate it and use it in our jsp. This instance is variable is called ‘id’.
We can also specific life time of this object by using ‘scope’ attribute
<jsp:useBean id=’name’ scope=”scope” class=”beanclass”/>


id: a case sensitive name is used.
Scope: The scope with in which the reference is available. page, request,session, application are possible values
page is default

class: the fully qualified classes name
bean name: The name of the java bean class
type: This type must be super class of the beans classes

One thought on “<jsp:useBean> tag and it’s properties?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.