public class ServletExternalContext extends java.lang.Object implements ExternalContext
| Constructor and Description |
|---|
ServletExternalContext(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Create a new external context wrapping given servlet HTTP request and response and given servlet context.
|
ServletExternalContext(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
FlowUrlHandler flowUrlHandler)
Create a new external context wrapping given servlet HTTP request and response and given servlet context.
|
| Modifier and Type | Method and Description |
|---|---|
SharedAttributeMap |
getApplicationMap()
Provides access to the external application map, providing a storage for data local to the current user
application and accessible to both internal and external SWF artifacts.
|
protected javax.servlet.ServletContext |
getContext()
Returns the servlet context.
|
java.lang.String |
getContextPath()
Returns the logical path to the application hosting this external context.
|
java.security.Principal |
getCurrentUser()
Provides access to the user's principal security object.
|
boolean |
getExternalRedirectRequested()
Returns the flag indicating if an external redirect response has been requested by the flow.
|
java.lang.String |
getExternalRedirectUrl()
Returns the URL to redirect to.
|
boolean |
getFlowDefinitionRedirectRequested()
Returns the flag indicating if a flow definition redirect response has been requested by the flow.
|
boolean |
getFlowExecutionRedirectRequested()
Returns the flag indicating if a flow execution redirect response has been requested by the flow.
|
java.lang.String |
getFlowExecutionUrl(java.lang.String flowId,
java.lang.String flowExecutionKey)
Get a flow execution URL for the execution with the provided key.
|
java.lang.String |
getFlowRedirectFlowId()
Returns the id of the flow definition to redirect to.
|
MutableAttributeMap |
getFlowRedirectFlowInput()
Returns the input to pass the flow definition through the redirect.
|
protected FlowUrlHandler |
getFlowUrlHandler()
Returns the configured flow url handler.
|
SharedAttributeMap |
getGlobalSessionMap()
Provides access to the global external session map, providing a storage for data globally accross the user
session and accessible to both internal and external SWF artifacts.
|
java.util.Locale |
getLocale()
Returns the client locale.
|
java.lang.Object |
getNativeContext()
Provides access to the context object for the current environment.
|
java.lang.Object |
getNativeRequest()
Provides access to the request object for the current environment.
|
java.lang.Object |
getNativeResponse()
Provides access to the response object for the current environment.
|
boolean |
getRedirectInPopup()
If a redirect response has been requested, indicates if the redirect should be issued from a popup dialog.
|
protected javax.servlet.http.HttpServletRequest |
getRequest()
Returns the underlying HttpServletRequest.
|
MutableAttributeMap |
getRequestMap()
Provides access to the external request attribute map, providing a storage for data local to the current user
request and accessible to both internal and external SWF artifacts.
|
ParameterMap |
getRequestParameterMap()
Provides access to the parameters associated with the user request that led to SWF being called.
|
protected javax.servlet.http.HttpServletResponse |
getResponse()
Returns the underlying HttpServletResponse.
|
java.io.Writer |
getResponseWriter()
Get a writer for writing out a response.
|
SharedAttributeMap |
getSessionMap()
Provides access to the external session map, providing a storage for data local to the current user session and
accessible to both internal and external SWF artifacts.
|
boolean |
isAjaxRequest()
Returns true if the current request is an asynchronous Ajax request.
|
boolean |
isResponseAllowed()
Is a render response allowed to be written for this request? Always return false after a response has been
completed.
|
boolean |
isResponseComplete()
Has the response been completed? Response complete status can be achieved by:
Writing out the response and calling
ExternalContext.recordResponseComplete(), or
Calling one of the redirect request methods
|
boolean |
isResponseCompleteFlowExecutionRedirect()
Returns true if the response has been completed with flow execution redirect request.
|
void |
recordResponseComplete()
Called by flow artifacts such as View states and end states to indicate they handled the response, typically by
writing out content to the response stream.
|
void |
requestExternalRedirect(java.lang.String location)
Request a redirect to an arbitrary resource location.
|
void |
requestFlowDefinitionRedirect(java.lang.String flowId,
MutableAttributeMap input)
Request that a flow definition redirect be performed by the calling environment.
|
void |
requestFlowExecutionRedirect()
Request that a flow execution redirect be performed by the calling environment.
|
void |
requestRedirectInPopup()
Request that the current redirect requested be sent to the client in a manner that causes the client to issue the
redirect from a popup dialog.
|
void |
setAjaxRequest(boolean ajaxRequest)
Indicates if the current request from this client is an ajax request.
|
public ServletExternalContext(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
context - the servlet contextrequest - the http servlet requestresponse - the http servlet responsepublic ServletExternalContext(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
FlowUrlHandler flowUrlHandler)
context - the servlet contextrequest - the http servlet requestresponse - the http servlet responseflowUrlHandler - the flow url handlerpublic void setAjaxRequest(boolean ajaxRequest)
ajaxRequest - the ajax request flagpublic java.lang.String getContextPath()
ExternalContextgetContextPath in interface ExternalContextpublic ParameterMap getRequestParameterMap()
ExternalContextgetRequestParameterMap in interface ExternalContextpublic MutableAttributeMap getRequestMap()
ExternalContextgetRequestMap in interface ExternalContextpublic SharedAttributeMap getSessionMap()
ExternalContextgetSessionMap in interface ExternalContextpublic SharedAttributeMap getGlobalSessionMap()
ExternalContext
Note: most external context implementations do not distinguish between the concept of a "local" user session
scope and a "global" session scope. The Portlet world does, but not the Servlet for example. In those cases
calling this method returns the same map as calling ExternalContext.getSessionMap().
getGlobalSessionMap in interface ExternalContextpublic SharedAttributeMap getApplicationMap()
ExternalContextgetApplicationMap in interface ExternalContextpublic java.security.Principal getCurrentUser()
ExternalContextgetCurrentUser in interface ExternalContextpublic java.util.Locale getLocale()
ExternalContextgetLocale in interface ExternalContextpublic java.lang.Object getNativeContext()
ExternalContextgetNativeContext in interface ExternalContextpublic java.lang.Object getNativeRequest()
ExternalContextgetNativeRequest in interface ExternalContextpublic java.lang.Object getNativeResponse()
ExternalContextgetNativeResponse in interface ExternalContextpublic boolean isAjaxRequest()
ExternalContextisAjaxRequest in interface ExternalContextpublic java.lang.String getFlowExecutionUrl(java.lang.String flowId,
java.lang.String flowExecutionKey)
ExternalContextgetFlowExecutionUrl in interface ExternalContextflowId - the flow definition idflowExecutionKey - the flow execution keypublic java.io.Writer getResponseWriter()
throws java.lang.IllegalStateException
ExternalContextgetResponseWriter in interface ExternalContextjava.lang.IllegalStateException - if the response has completed or is not allowedpublic boolean isResponseAllowed()
ExternalContextisResponseAllowed in interface ExternalContextpublic boolean isResponseComplete()
ExternalContextExternalContext.recordResponseComplete(), or
isResponseComplete in interface ExternalContextExternalContext.getResponseWriter(),
ExternalContext.recordResponseComplete(),
ExternalContext.requestFlowExecutionRedirect(),
ExternalContext.requestFlowDefinitionRedirect(String, MutableAttributeMap),
ExternalContext.requestExternalRedirect(String)public void recordResponseComplete()
ExternalContextrecordResponseComplete in interface ExternalContextpublic boolean isResponseCompleteFlowExecutionRedirect()
ExternalContextisResponseCompleteFlowExecutionRedirect in interface ExternalContextExternalContext.isResponseComplete(),
ExternalContext.requestFlowExecutionRedirect()public void requestFlowExecutionRedirect()
throws java.lang.IllegalStateException
ExternalContextrequestFlowExecutionRedirect in interface ExternalContextjava.lang.IllegalStateException - if the response has completedExternalContext.isResponseComplete()public void requestFlowDefinitionRedirect(java.lang.String flowId,
MutableAttributeMap input)
throws java.lang.IllegalStateException
ExternalContextrequestFlowDefinitionRedirect in interface ExternalContextflowId - the id of the flow definition to redirect toinput - input to pass the flow; this input is generally encoded the url to launch the flowjava.lang.IllegalStateException - if the response has completedExternalContext.isResponseComplete()public void requestExternalRedirect(java.lang.String location)
throws java.lang.IllegalStateException
ExternalContextrequestExternalRedirect in interface ExternalContextlocation - the location of the resource to redirect tojava.lang.IllegalStateException - if the response has completedExternalContext.isResponseComplete()public void requestRedirectInPopup()
throws java.lang.IllegalStateException
ExternalContextrequestRedirectInPopup in interface ExternalContextjava.lang.IllegalStateException - if a redirect has not been requestedExternalContext.requestFlowExecutionRedirect(),
ExternalContext.requestFlowDefinitionRedirect(String, MutableAttributeMap),
ExternalContext.requestExternalRedirect(String)public boolean getFlowExecutionRedirectRequested()
public boolean getFlowDefinitionRedirectRequested()
public java.lang.String getFlowRedirectFlowId()
getFlowDefinitionRedirectRequested()
returns true.public MutableAttributeMap getFlowRedirectFlowInput()
getFlowDefinitionRedirectRequested() returns true.public boolean getExternalRedirectRequested()
public java.lang.String getExternalRedirectUrl()
getExternalRedirectRequested() returns true.public boolean getRedirectInPopup()
protected javax.servlet.ServletContext getContext()
protected javax.servlet.http.HttpServletRequest getRequest()
protected javax.servlet.http.HttpServletResponse getResponse()
protected FlowUrlHandler getFlowUrlHandler()