TagLib: Util

session

Description

The session tag provides access to session attributes.

Tag Body

Empty

Restrictions

If the id attribute is specified then the page attribute is restored using the session attribute. If the name attribute is specified then the session attribute is saved using the page attribute. If neither is specified then the session attribute is removed.

Attributes

This tag has the following attributes:

Attribute

Description

Req'd?

id Name of the page attribute to restore from the session attribute. No
name Name of the page attribute to save into the session attribute. No
attribute Name of the session attribute to operate on. Yes

Properties

None.

Example(s)


<%-- create a date bean to use --%>
<util:bean id="now" type="java.util.Date"/>

<%-- save that bean into the session attributes --%>
<util:session name="now" attribute="viewDay">

<%-- restore from the session attributes --%>
<util:session id="now" attribute="viewDay"/>

<%-- remove the bean from the session attributes --%>
<util:session attribute="viewDay"/>