public class

PortletRequestAttributes

extends AbstractRequestAttributes
java.lang.Object
   ↳ org.springframework.web.context.request.AbstractRequestAttributes
     ↳ org.springframework.web.portlet.context.PortletRequestAttributes
Known Direct Subclasses

Class Overview

Portlet-based implementation of the RequestAttributes interface.

Accesses objects from portlet request and portlet session scope, with a distinction between "session" (the PortletSession's "portlet scope") and "global session" (the PortletSession's "application scope").

See Also
  • javax.portlet.PortletRequest#getAttribute
  • javax.portlet.PortletSession#getAttribute
  • javax.portlet.PortletSession#PORTLET_SCOPE
  • javax.portlet.PortletSession#APPLICATION_SCOPE
  • SCOPE_SESSION
  • SCOPE_GLOBAL_SESSION

Summary

[Expand]
Inherited Constants
From interface org.springframework.web.context.request.RequestAttributes
Fields
public static final String DESTRUCTION_CALLBACK_NAME_PREFIX Constant identifying the String prefixed to the name of a destruction callback when it is stored in a PortletSession.
[Expand]
Inherited Fields
From class org.springframework.web.context.request.AbstractRequestAttributes
Public Constructors
PortletRequestAttributes(PortletRequest request)
Create a new PortletRequestAttributes instance for the given request.
Public Methods
Object getAttribute(String name, int scope)
String[] getAttributeNames(int scope)
final PortletRequest getRequest()
Exposes the native PortletRequest that we're wrapping.
String getSessionId()
Object getSessionMutex()
void registerDestructionCallback(String name, Runnable callback, int scope)
void removeAttribute(String name, int scope)
Object resolveReference(String key)
void setAttribute(String name, Object value, int scope)
String toString()
Protected Methods
final PortletSession getSession(boolean allowCreate)
Exposes the PortletSession that we're wrapping.
void registerSessionDestructionCallback(String name, Runnable callback)
Register the given callback as to be executed after session termination.
void updateAccessedSessionAttributes()
Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.
[Expand]
Inherited Methods
From class org.springframework.web.context.request.AbstractRequestAttributes
From class java.lang.Object
From interface org.springframework.web.context.request.RequestAttributes

Fields

public static final String DESTRUCTION_CALLBACK_NAME_PREFIX

Constant identifying the String prefixed to the name of a destruction callback when it is stored in a PortletSession.

Public Constructors

public PortletRequestAttributes (PortletRequest request)

Create a new PortletRequestAttributes instance for the given request.

Parameters
request current portlet request

Public Methods

public Object getAttribute (String name, int scope)

public String[] getAttributeNames (int scope)

public final PortletRequest getRequest ()

Exposes the native PortletRequest that we're wrapping.

public String getSessionId ()

public Object getSessionMutex ()

public void registerDestructionCallback (String name, Runnable callback, int scope)

public void removeAttribute (String name, int scope)

public Object resolveReference (String key)

public void setAttribute (String name, Object value, int scope)

public String toString ()

Protected Methods

protected final PortletSession getSession (boolean allowCreate)

Exposes the PortletSession that we're wrapping.

Parameters
allowCreate whether to allow creation of a new session if none exists yet

protected void registerSessionDestructionCallback (String name, Runnable callback)

Register the given callback as to be executed after session termination.

Note: The callback object should be serializable in order to survive web app restarts.

Parameters
name the name of the attribute to register the callback for
callback the callback to be executed for destruction

protected void updateAccessedSessionAttributes ()

Update all accessed session attributes through session.setAttribute calls, explicitly indicating to the container that they might have been modified.