The session tag provides access to session attributes.
Empty
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.
This tag has the following attributes for which the Required values are “Yes” and “No”:
Name of the page attribute to restore from the session attribute.
Name of the page attribute to save into the session attribute.
Name of the session attribute to operate on.
None.
<%-- 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"/>