com.acsinet_solutions.cetia4.controller
Interface RequestContext

All Superinterfaces:
ParameterAccessor
All Known Subinterfaces:
ActionContext, MultipartContext, RenderContext, ServletRequestContext
All Known Implementing Classes:
AbstractServletRequestContext, WebServiceServletRequestContext, WebServletRequestContext

public interface RequestContext
extends ParameterAccessor

Base interface for request contexts. All servlet and portlet request contexts in both render and action phases inherit from this basic generic interface.

Author:
Santiago Arriaga

Method Summary
 java.lang.Object getAttribute(Scope scope, java.lang.String key)
          Get an attribute from the given scope.
 java.lang.Object getComponentAttribute(java.lang.String key)
          Get a component session attribute.
 Configuration getConfiguration()
          Get a reference to the not-null configuration of the current module
 java.lang.Object getContextAttribute(java.lang.String key)
          Get an application attribute
 java.lang.String getContextPath()
          Convenience method for obtaining the context path.
 java.lang.String getMethod()
          Get the not null String method to be executed by the current call.
 java.util.List<java.lang.String> getPathInfo()
          Get the path info as a list of Strings.
 java.lang.Object getRequestAttribute(java.lang.String key)
          Get a request attribute
 java.lang.String getRequestedController()
          Get the requested controller with path info, not containing context path nor query String.
 java.lang.String getRequestedPage()
          Get the requested page, containing all request string with path info and query string.
 java.lang.String getRequestedURI()
          Get the requested page, containing all request string with path info but no query string.
 java.lang.String getRequestType()
          Get the request type; it may be any constant of the RequestType interface or a custom request type ( although extensibility mechanisms are still not provided in this version ).
 SecurityContext getSecurityContext()
          Get the security context associated to the current request.
 java.lang.Object getSessionAttribute(java.lang.String key)
          Get a session attribute
 void invalidateSession()
          Invalidate the current session.
 void redirectTo(java.lang.String url)
          Perform a redirection.
 void removeAttribute(Scope scope, java.lang.String key)
          Remove an attribute on the given scope.
 void removeComponentAttribute(java.lang.String key)
          Set a component session attribute.
 void removeContextAttribute(java.lang.String key)
          Remove an application attribute
 void removeRequestAttribute(java.lang.String key)
          Remove a request attribute
 void removeSessionAttribute(java.lang.String key)
          Set a session attribute
 boolean sessionExists()
          Check if the session exists or not.
 void setAttribute(Scope scope, java.lang.String key, java.lang.Object value)
          Set an attribute on the given scope.
 void setComponentAttribute(java.lang.String key, java.lang.Object attribute)
          Set a component session attribute.
 void setContextAttribute(java.lang.String key, java.lang.Object attribute)
          Set an application attribute
 void setFormAttribute(java.lang.Object bean)
          Sets the FORM_ATTRIBUTE object.
 void setMessage(java.lang.String message)
          Set a message in portlet or session level.
 void setRequestAttribute(java.lang.String key, java.lang.Object attribute)
          Set a request attribute
 void setSessionAttribute(java.lang.String key, java.lang.Object attribute)
          Set a session attribute
 void setSystemException(java.lang.Exception exception)
          Set a system exception in portlet or session level.
 void setValidationException(java.lang.Exception exception)
          Set a validation exception in portlet or session level.
 
Methods inherited from interface com.acsinet_solutions.cetia4.controller.ParameterAccessor
getParameter, getParameterMap
 

Method Detail

getConfiguration

Configuration getConfiguration()
Get a reference to the not-null configuration of the current module


getRequestType

java.lang.String getRequestType()
Get the request type; it may be any constant of the RequestType interface or a custom request type ( although extensibility mechanisms are still not provided in this version ).

See Also:
RequestType

getContextPath

java.lang.String getContextPath()
Convenience method for obtaining the context path.


getPathInfo

java.util.List<java.lang.String> getPathInfo()
Get the path info as a list of Strings.


getRequestedPage

java.lang.String getRequestedPage()
Get the requested page, containing all request string with path info and query string.

See Also:
ControllerTools.getRequestedPage(HttpServletRequest)

getRequestedURI

java.lang.String getRequestedURI()
Get the requested page, containing all request string with path info but no query string.

See Also:
HttpServletRequest.getRequestURI()

getRequestedController

java.lang.String getRequestedController()
Get the requested controller with path info, not containing context path nor query String.

See Also:
ControllerTools.getRequestedController(HttpServletRequest)

setContextAttribute

void setContextAttribute(java.lang.String key,
                         java.lang.Object attribute)
Set an application attribute


setRequestAttribute

void setRequestAttribute(java.lang.String key,
                         java.lang.Object attribute)
Set a request attribute


setComponentAttribute

void setComponentAttribute(java.lang.String key,
                           java.lang.Object attribute)
Set a component session attribute. In web applications, this is similar to working at session level; in portlet applications this sets a portlet session attribute

See Also:
Scope.COMPONENT_SCOPE

setSessionAttribute

void setSessionAttribute(java.lang.String key,
                         java.lang.Object attribute)
Set a session attribute


removeContextAttribute

void removeContextAttribute(java.lang.String key)
Remove an application attribute


removeRequestAttribute

void removeRequestAttribute(java.lang.String key)
Remove a request attribute


removeComponentAttribute

void removeComponentAttribute(java.lang.String key)
Set a component session attribute. In web applications, this is similar to working at session level; in portlet applications this removes a portlet session attribute

See Also:
Scope.COMPONENT_SCOPE

removeSessionAttribute

void removeSessionAttribute(java.lang.String key)
Set a session attribute


getContextAttribute

java.lang.Object getContextAttribute(java.lang.String key)
Get an application attribute


getRequestAttribute

java.lang.Object getRequestAttribute(java.lang.String key)
Get a request attribute


getComponentAttribute

java.lang.Object getComponentAttribute(java.lang.String key)
Get a component session attribute. In web applications, this is similar to working at session level; in portlet applications this gets a portlet session attribute.

See Also:
Scope.COMPONENT_SCOPE

getSessionAttribute

java.lang.Object getSessionAttribute(java.lang.String key)
Get a session attribute


setSystemException

void setSystemException(java.lang.Exception exception)
Set a system exception in portlet or session level.

See Also:
AttributeKeys._SYSTEM_EXCEPTION_KEY

setValidationException

void setValidationException(java.lang.Exception exception)
Set a validation exception in portlet or session level. The provided exception should preferably be a ValidationException or a ValidationRuntimeException

See Also:
AttributeKeys._VALIDATION_EXCEPTION_KEY

setMessage

void setMessage(java.lang.String message)
Set a message in portlet or session level. Messages are stored not as strings but as a CompoundMessage, so this method may be called more than once to display different messages on a page.

See Also:
AttributeKeys._MESSAGE_KEY, CompoundMessage

getMethod

java.lang.String getMethod()
Get the not null String method to be executed by the current call. May be an empty String for default methods. Action methods must always be not empty.

See Also:
ControllerConstants._METHOD_PARAM, AbstractServletRequestContext.METHOD_PREFIX

setFormAttribute

void setFormAttribute(java.lang.Object bean)
Sets the FORM_ATTRIBUTE object. if the form attribute is not set at request level, this call will throw an IllegalStateException.

See Also:
AttributeKeys._FORM_ATTRIBUTE_KEY, FormAttribute

getAttribute

java.lang.Object getAttribute(Scope scope,
                              java.lang.String key)
Get an attribute from the given scope.


setAttribute

void setAttribute(Scope scope,
                  java.lang.String key,
                  java.lang.Object value)
Set an attribute on the given scope.


removeAttribute

void removeAttribute(Scope scope,
                     java.lang.String key)
Remove an attribute on the given scope.


sessionExists

boolean sessionExists()
Check if the session exists or not. Obviously, it does not create a session object if it is not needed ( but other methods and facilities in and outside the framework may call getSession() indiscriminately ).


invalidateSession

void invalidateSession()
Invalidate the current session.


redirectTo

void redirectTo(java.lang.String url)
                throws java.io.IOException
Perform a redirection. This may throw an unchecked exception if called in portlets render phase where redirection is forbidden.

Throws:
java.io.IOException

getSecurityContext

SecurityContext getSecurityContext()
Get the security context associated to the current request. If no security service is configured in the application service locator, a generic all-inclusive security context will be returned.