Sun Java System Portal Server Mobile Access 7.1 Developer's Guide

Understanding the ContextTag Class

The ContextTag class resides in the same package as Context and ContextCache. This class is a simple class that represents a context tag.

A context tag represents the session state for an valid authenticated connection to a backend service. This tag validates that the session is still valid and provides a context for other tags to make requests to that service. At the first request, a connection is made to the backend service using configuration and authentication information. The session service context or state is stored in the session so that the context or state is available across requests.

A context tag does the following:

The ContextTag class defines an abstract findContext method, which finds the context this tag represents:

public abstract Context findContext() throws Exception;

Subclasses must implement this method to return the appropriate context for the session. For an example of this, see Extending the Tag Library.