# com.bea.netuix.servlets.controls.content
JspContentContext Class

public class JspContentContext
extends `ControlContext`

This is a context to support simple JSP portlets with or without backing files. You can use this class directly from a JSP.

All the setter methods in this class should only be called during the `handlePostbackData` method of the backing file. The framework acts on the changes after completion of this method.

Hierarchy
  `Object`
  `ControlContext`
  `JspContentContext`

All Implemented Interfaces
  `Serializable`

## Field Summary

`protected static final `String`` | `CLASS_NAME` String
`public static final `String`` | `CONTENT_CHANGE` String
`public static final `String`` | `CONTROL_PARAM` The unique id request parameter to identify the source of a JspContentContext.
`public static final `String`` | `EVENT_PARAM` The request parameter to indicate the action to be performed by this object.

Fields from com.bea.netuix.servlets.controls`.`ControlContext``
`debug`

## Constructor Summary

JspContentContext() Constructs `JspContentContext` .
JspContentContext(`UIControl` control) Constructs `JspContentContext` .

## Method Summary

`public `PostbackURL`` | `getBaseUrl`(`HttpServletRequest` request, `HttpServletResponse` response, `String` event) Returns a URL that can be used to submit requests.
`public `PostbackURL`` | `getBaseUrl`(`HttpServletRequest` request, `HttpServletResponse` response, `String` param, `String` event) Returns a URL that can be used to submit requests.
`public `String`` | `getContentUri`() Returns the current URI of the content JSP, if non-null.
`public static `JspContentContext`` | `getJspContentContext`(`HttpServletRequest` request) Retrieves this context from the request
`public `Locale`` | `getResolvedLocale`() Sets the Locale used when resolving the current URI
`protected `String`` | `getSendRedirectPath`() Returns the redirect path if set.
`public void` | `sendRedirect`(`String` path) Redirects the client to the given path.
`public final void` | `setActivePage`(`String` pageLabel) Changes the active page.
`public void` | `setContentUri`(`String` contentUri) Sets the URI of the content JSP.
`public void` | `setJspContentContextInRequest`(`HttpServletRequest` request) Sets this context in the request.
`public void` | `setResolvedLocale`(`Locale` locale) Sets the Locale used when resolving the current URI
`public void` | `setupModeChangeEvent`(`WindowMode` modeValue) Sets up a mode change event.
`public void` | `setupStateChangeEvent`(`WindowState` stateValue) Sets up a state change event.

Methods from `com.bea.netuix.servlets.controls.`ControlContext``
`getContextFromRequest, getContextKey, getControl, getRequestKey, getUniqueId, removeContextFromRequest, setContextInRequest`

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Detail

### CLASS_NAME

    protected static final String CLASS_NAME

### CONTENT_CHANGE

    public static final String CONTENT_CHANGE

### CONTROL_PARAM

    public static final String CONTROL_PARAM

  The unique id request parameter to identify the source of a JspContentContext.

### EVENT_PARAM

    public static final String EVENT_PARAM

  The request parameter to indicate the action to be performed by this object.

## Constructor Detail

### JspContentContext

    public JspContentContext()

  Constructs `JspContentContext`

  .

### JspContentContext

    public JspContentContext(UIControl control)

  Constructs `JspContentContext`

  .

## Method Detail

### getBaseUrl(HttpServletRequest, HttpServletResponse, String) Method

    public PostbackURL getBaseUrl(HttpServletRequest request,
                                  HttpServletResponse response,
                                  String event)

Returns a URL that can be used to submit requests.

#### Parameters

request
  HTTP request

response
  HTTP response

event
  event

#### Returns

URL

### getBaseUrl(HttpServletRequest, HttpServletResponse, String, String) Method

    public PostbackURL getBaseUrl(HttpServletRequest request,
                                  HttpServletResponse response,
                                  String param,
                                  String event)

Returns a URL that can be used to submit requests.

#### Parameters

request
  HTTP request

response
  HTTP response

param
  name of parameter

event
  event

#### Returns

URL

### getContentUri() Method

    public String getContentUri()

Returns the current URI of the content JSP, if non-null. If the URI has been set to null, returns the original URI as set when this object was initialized.

#### Returns

content URI

### getJspContentContext(HttpServletRequest) Method

    public static JspContentContext getJspContentContext(HttpServletRequest request)

Retrieves this context from the request

### getResolvedLocale() Method

    public Locale getResolvedLocale()

Sets the Locale used when resolving the current URI

### getSendRedirectPath() Method

    protected String getSendRedirectPath()

Returns the redirect path if set.

#### Returns

redirect path

### sendRedirect(String) Method

    public void sendRedirect(String path)

Redirects the client to the given path. The path set should follow the same rules that apply to the `sendRedirect` method in `javax.servlet.http.HttpServletResponse`. This method should only be called during postback. Note that the actual redirect happens after executing the `handlePostbackData` method on the backing file.

#### Parameters

path
  path

### setActivePage(String) Method

    public final void setActivePage(String pageLabel)

Changes the active page. Should be called only during postback.

#### Parameters

pageLabel
  page label

### setContentUri(String) Method

    public void setContentUri(String contentUri)

Sets the URI of the content JSP.

#### Parameters

contentUri
  content URI

### setJspContentContextInRequest(HttpServletRequest) Method

    public void setJspContentContextInRequest(HttpServletRequest request)

Sets this context in the request.

#### Parameters

request
  HTTP request

### setResolvedLocale(Locale) Method

    public void setResolvedLocale(Locale locale)

Sets the Locale used when resolving the current URI

### setupModeChangeEvent(WindowMode) Method

    public void setupModeChangeEvent(WindowMode modeValue)

Sets up a mode change event. Should be called only during postback

#### Parameters

modeValue
  mode

### setupStateChangeEvent(WindowState) Method

    public void setupStateChangeEvent(WindowState stateValue)

Sets up a state change event. Should be called only during postback

#### Parameters

stateValue
  state