TagLib: Util

bean

Description

This tag makes the specified bean object available to the page. It is essentially the same as <jsp:useBean> except that it interoperates with the other bean tags in this tag library.

Tag Body

Empty

Restrictions

If the name attribute is not specified then uses a parent bean tag to locate the bean on which to operate. The type attribute specifies the java class name of the object to use or create.

Attributes

This tag has the following attributes:

Attribute

Description

Req'd?

id Name of the bean to create. No
name Name of the bean to use. No
type Type of the bean; a java class name. Yes

Properties

All the bean properties of the bean type created are available.

Example(s)


<%-- make a date available --%>
<util:bean type="java.util.Date">
date = <util:get/>
</util:bean>

<%-- make a named date available --%>
<util:bean id="date" type="java.util.Date"/>
date = <util:get name="date"/>
</util:bean>