|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectPageFlowUtils
public class PageFlowUtils
Utility methods related to Page Flow.
Field Summary |
---|
Fields inherited from interface InternalConstants |
---|
ACTION_EXTENSION_LEN, ACTION_OVERRIDE_PREFIX, ANNOTATION_QUALIFIER, ATTR_PREFIX, BACKING_CLASS_IMPLICIT_OBJECT, BEGIN_ACTION_PATH, CURRENT_JPF_ATTR, CURRENT_LONGLIVED_ATTR, FACES_BACKING_ATTR, FACES_BACKING_EXTENSION, FACES_EXTENSION, FACES_EXTENSION_DOT, GLOBALAPP_CLASSNAME, GLOBALAPP_MEMBER_NAME, GLOBALAPP_MODULE_CONTEXT_PATH, INTERNAL_VAR_PREFIX, JSF_EXTENSION, JSF_EXTENSION_DOT, MESSAGE_IS_EXPRESSION_PREFIX, MESSAGE_IS_EXPRESSION_PREFIX_LENGTH, NETUI_CONFIG_PATH, RETURN_ACTION_VIEW_RENDERER_PARAM, RETURNING_FORM_ATTR, RETURNING_FROM_NESTING_ATTR, SAVED_PREVIOUS_PAGE_INFO_ATTR, SHARED_FLOW_ATTR_PREFIX, SHARED_FLOW_EXTENSION, SHARED_FLOW_MODULE_PREFIX, SHARED_FLOW_MODULE_PREFIX_LEN, SHARED_FLOW_ROOT_MODULE, WEBINF_DIR |
Constructor Summary | |
---|---|
PageFlowUtils()
|
Method Summary | |
---|---|
static void |
addActionError(ServletRequest request,
String propertyName,
String messageKey)
Add a property-related message that will be shown with the Errors and Error tags. |
static void |
addActionError(ServletRequest request,
String propertyName,
String messageKey,
Object messageArg)
Add a property-related message that will be shown with the Errors and Error tags. |
static void |
addActionError(ServletRequest request,
String propertyName,
String messageKey,
Object[] messageArgs)
Add a property-related message that will be shown with the Errors and Error tags. |
static void |
addActionError(ServletRequest request,
String propertyName,
String messageKey,
Object messageArg1,
Object messageArg2)
Add a property-related message that will be shown with the Errors and Error tags. |
static void |
addActionError(ServletRequest request,
String propertyName,
String messageKey,
Object messageArg1,
Object messageArg2,
Object messageArg3)
Add a property-related message that will be shown with the Errors and Error tags. |
static void |
addActionErrorExpression(HttpServletRequest request,
String propertyName,
String expression,
Object[] messageArgs)
Add a property-related message as an expression that will be evaluated and shown with the Errors and Error tags. |
static void |
addActionOutput(String name,
Object value,
ServletRequest request)
Set a named action output, which corresponds to an input declared by the pageInput JSP tag. |
static void |
addBindingUpdateError(ServletRequest request,
String expression,
String message,
Throwable e)
Deprecated. This is an internal utility. InternalUtils.addBindingUpdateError(javax.servlet.ServletRequest, java.lang.String, java.lang.String, java.lang.Throwable) can be used, but it is
not guaranteed to be supported in the future. |
static void |
addPageInput(String name,
Object value,
ServletRequest request)
Deprecated. Use addActionOutput(java.lang.String, java.lang.Object, javax.servlet.ServletRequest) instead. |
static void |
addValidationError(String propertyName,
String messageKey,
Object[] messageArgs,
ServletRequest request)
Deprecated. Use addActionError(ServletRequest, String, String, Object[]) instead. |
static void |
addValidationError(String propertyName,
String messageKey,
Object messageArg,
ServletRequest request)
Deprecated. Use addActionError(ServletRequest, String, String, Object[]) instead. |
static void |
addValidationError(String propertyName,
String messageKey,
ServletRequest request)
Deprecated. Use addActionError(ServletRequest, String, String, Object[]) instead. |
static URLTemplatesFactory |
createURLTemplatesFactory(ServletContext servletContext)
Get an uninitialized instance of a container specific URLTemplatesFactory from the ServletContainerAdapter. |
static void |
destroyPageFlowStack(HttpServletRequest request)
Deprecated. Use PageFlowStack.destroy(javax.servlet.http.HttpServletRequest) instead. |
static void |
dumpRequest(HttpServletRequest request,
PrintStream output)
Deprecated. This is an internal utility. ServletUtils.dumpRequest(javax.servlet.ServletRequest, java.io.PrintStream) can be used, but it is
not guaranteed to be supported in the future. |
static void |
dumpServletContext(ServletContext context,
PrintStream output)
Deprecated. This is an internal utility. ServletUtils.dumpServletContext(javax.servlet.ServletContext, java.io.PrintStream) can be used, but it is
not guaranteed to be supported in the future. |
static boolean |
ensureAppDeployment(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Deprecated. This method no longer has any effect, and will be removed without replacement in a future release. |
static PageFlowController |
ensureCurrentPageFlow(HttpServletRequest request,
HttpServletResponse response)
Deprecated. Use getCurrentPageFlow(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext) instead. |
static PageFlowController |
ensureCurrentPageFlow(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Deprecated. Use getCurrentPageFlow(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext) instead. |
static GlobalApp |
ensureGlobalApp(HttpServletRequest request,
HttpServletResponse response)
Deprecated. Use getGlobalApp(javax.servlet.http.HttpServletRequest) instead. |
static GlobalApp |
ensureGlobalApp(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Deprecated. Use getSharedFlow(java.lang.String, javax.servlet.http.HttpServletRequest) instead. |
static ModuleConfig |
ensureModuleConfig(String modulePath,
ServletRequest request,
ServletContext context)
Deprecated. This is an internal utility. InternalUtils.ensureModuleConfig(java.lang.String, javax.servlet.ServletContext) can be used, but it is
not guaranteed to be supported in the future. |
static Object |
getActionOutput(String name,
ServletRequest request)
Get a named action output that was registered in the current request. |
static MutableURI |
getActionURI(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
String actionName)
Create a raw action URI, which can be modified before being sent through the registered URL rewriting chain using URLRewriterService.rewriteURL(javax.servlet.ServletContext, javax.servlet.ServletRequest, javax.servlet.ServletResponse, org.apache.beehive.netui.core.urls.MutableURI, org.apache.beehive.netui.core.urls.URLType, boolean) . |
static String |
getActionURI(ServletRequest request)
Get the most recent action URI that was processed by FlowController.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) . |
static String |
getBeginActionURI(String requestURI)
Get a URI for the "begin" action in the PageFlowController associated with the given request URI. |
static Map |
getBindingUpdateErrors(ServletRequest request)
Deprecated. This is an internal utility. InternalUtils.getBindingUpdateErrors(javax.servlet.ServletRequest) can be used, but it is
not guaranteed to be supported in the future. |
static ActionResolver |
getCurrentActionResolver(HttpServletRequest request)
Deprecated. Use getCurrentPageFlow(HttpServletRequest, ServletContext) instead. |
static ActionResolver |
getCurrentActionResolver(HttpServletRequest request,
ServletContext servletContext)
Deprecated. Use getCurrentPageFlow(HttpServletRequest, ServletContext) instead. |
static PageFlowController |
getCurrentPageFlow(HttpServletRequest request)
Deprecated. Use getCurrentPageFlow(HttpServletRequest, ServletContext) instead. |
static PageFlowController |
getCurrentPageFlow(HttpServletRequest request,
ServletContext servletContext)
Get the current PageFlowController . |
static String |
getFileExtension(String filename)
Deprecated. Use FileUtils.getFileExtension(java.lang.String) instead. |
static String |
getFormBeanName(ActionForm formInstance,
HttpServletRequest request)
Get the name for the type of a ActionForm instance. |
static String |
getFormBeanName(Class formBeanClass,
HttpServletRequest request)
Get the name for an ActionForm type. |
static GlobalApp |
getGlobalApp(HttpServletRequest request)
Deprecated. Use getSharedFlow(java.lang.String, javax.servlet.http.HttpServletRequest) instead. |
static ModuleConfig |
getGlobalAppConfig(ServletContext servletContext)
Deprecated. This will be removed with no replacement in a future release. |
static String |
getJpfClassName(String uri)
Deprecated. Use getPageFlowClassName(String) instead. |
static PageFlowController |
getLongLivedPageFlow(String modulePath,
HttpServletRequest request)
Deprecated. Use getLongLivedPageFlow(String, HttpServletRequest, ServletContext) instead. |
static PageFlowController |
getLongLivedPageFlow(String modulePath,
HttpServletRequest request,
ServletContext servletContext)
Get the long-lived page flow instance associated with the given module (directory) path. |
static ModuleConfig |
getModuleConfig(String modulePath,
ServletContext context)
Deprecated. This is an internal utility. InternalUtils.getModuleConfig(java.lang.String, javax.servlet.ServletContext) can be used, but it is
not guaranteed to be supported in the future. |
static String |
getModuleConfPath(String modulePath)
Deprecated. Use PageFlowActionServlet.getModuleConfPath(java.lang.String) instead.
Get the path to the Struts module configration file (e.g.,
"/WEB-INF/classes/_pageflow/struts-config-someModule") for a given module
path (e.g., "someModule"), according to the PageFlow convention. |
static String |
getModulePath(HttpServletRequest request)
Get the Struts module path for the current request URI. |
static String |
getModulePath(HttpServletRequest request,
String requestURI)
Get the Struts module path for a URI. |
static String |
getModulePathForRelativeURI(String uri)
Get the Struts module path for a URI that is relative to the web application root. |
static PageFlowController |
getNestingPageFlow(HttpServletRequest request)
Deprecated. Use getNestingPageFlow(HttpServletRequest, ServletContext) instead. |
static PageFlowController |
getNestingPageFlow(HttpServletRequest request,
ServletContext servletContext)
Get the PageFlowController that is nesting the current one. |
static String |
getPageFlowClassName(String uri)
Get the class name of a PageFlowController , given the URI to it. |
static String |
getPageFlowClassName(String modulePath,
ServletRequest request,
ServletContext context)
Deprecated. This is an internal utility. InternalUtils.getFlowControllerClassName(java.lang.String, javax.servlet.ServletRequest, javax.servlet.ServletContext) can be used, but it is
not guaranteed to be supported in the future. |
static Stack |
getPageFlowStack(HttpServletRequest request)
Deprecated. Use PageFlowStack.get(HttpServletRequest, ServletContext) instead. |
static String |
getPageFlowURI(String className)
Get the URI for a PageFlowController , given its class name. |
static Object |
getPageInput(String name,
ServletRequest request)
Deprecated. Use getActionOutput(java.lang.String, javax.servlet.ServletRequest) instead. |
static String |
getRelativeURI(HttpServletRequest request,
PageFlowController relativeTo)
Get the request URI, relative to the URI of the given PageFlowController. |
static String |
getRelativeURI(HttpServletRequest request,
String uri,
PageFlowController relativeTo)
Get a URI relative to the URI of the given PageFlowController. |
static String |
getRewrittenActionURI(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
String actionName,
Map params,
String fragment,
boolean forXML)
Create a fully-rewritten URI given an action name and parameters. |
static String |
getRewrittenHrefURI(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
String path,
Map params,
String fragment,
boolean forXML)
Create a fully-rewritten URI given a path and parameters. |
static String |
getRewrittenResourceURI(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
String path,
Map params,
String fragment,
boolean forXML)
Create a fully-rewritten URI given a path and parameters. |
static SecurityProtocol |
getSecurityProtocol(String uri,
ServletContext servletContext,
HttpServletRequest request)
Tell whether a web application resource requires a secure transport protocol. |
static SharedFlowController |
getSharedFlow(String sharedFlowClassName,
HttpServletRequest request)
Deprecated. Use getSharedFlow(String, HttpServletRequest, ServletContext) instead. |
static SharedFlowController |
getSharedFlow(String sharedFlowClassName,
HttpServletRequest request,
ServletContext servletContext)
Get the shared flow with the given class name. |
static Map |
getSharedFlows(HttpServletRequest request)
Get the a map of shared flow name to shared flow instance, based on the names defined in the sharedFlowRefs attribute
of the @Jpf.Controller annotation on the
current page flow. |
static String |
getURLTemplateKey(URLType urlType,
boolean needsToBeSecure)
Returns a key for the URL template type given the URL type and a flag indicating a secure URL or not. |
static boolean |
isAbsoluteURI(String uri)
Deprecated. Use FileUtils.isAbsoluteURI(java.lang.String) instead. |
static Boolean |
isSecureResource(String uri,
ServletContext context)
Deprecated. Use getSecurityProtocol(String, ServletContext, HttpServletRequest) instead. |
static boolean |
needsToBeSecure(ServletContext context,
ServletRequest request,
String uri,
boolean stripContextPath)
Tell whether a given URI should be written to be secure. |
static void |
preventCache(HttpServletResponse response)
Deprecated. Use ServletUtils.preventCache(javax.servlet.ServletResponse) instead. |
static void |
removeLongLivedPageFlow(String modulePath,
HttpServletRequest request)
Deprecated. Use removeLongLivedPageFlow(String, HttpServletRequest, ServletContext) instead. |
static void |
removeLongLivedPageFlow(String modulePath,
HttpServletRequest request,
ServletContext servletContext)
Remove a "long-lived" page flow from the session. |
static void |
removeSharedFlow(String sharedFlowClassName,
HttpServletRequest request)
Deprecated. Use removeSharedFlow(String, HttpServletRequest, ServletContext) instead. |
static void |
removeSharedFlow(String sharedFlowClassName,
HttpServletRequest request,
ServletContext servletContext)
Destroy the current SharedFlowController of the given class name. |
static void |
setCurrentActionResolver(ActionResolver resolver,
HttpServletRequest request)
Deprecated. This is an internal utility. InternalUtils.setCurrentActionResolver(org.apache.beehive.netui.pageflow.ActionResolver, javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext) can be used, but it is
not guaranteed to be supported in the future. This method will be removed in the next version. |
static void |
setOutputForm(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
boolean overwrite)
Make a form bean available as an attributet in the request/session (as appropriate). |
static void |
setOutputForms(ActionMapping mapping,
ActionForm[] outputForms,
HttpServletRequest request)
Make a set of form beans available as attributets in the request/session (as appropriate). |
static void |
setOutputForms(ActionMapping mapping,
ActionForm[] outputForms,
HttpServletRequest request,
boolean overwrite)
Make a set of form beans available as attributets in the request/session (as appropriate). |
static void |
setOutputForms(ActionMapping mapping,
Forward fwd,
HttpServletRequest request)
Make any form beans in the given Forward object available as attributets in the
request/session (as appropriate). |
static void |
setOutputForms(ActionMapping mapping,
Forward fwd,
HttpServletRequest request,
boolean overwrite)
Make any form beans in the given Forward object available as attributets in the
request/session (as appropriate). |
static ActionResult |
strutsLookup(ServletContext context,
ServletRequest request,
HttpServletResponse response,
String actionOverride,
String[] autoResolveExtensions)
Resolve the given action to a URI by running an entire request-processing cycle on the given ScopedRequest and ScopedResponse. |
static HttpServletRequest |
unwrapMultipart(HttpServletRequest request)
If the given request is a MultipartRequestWrapper (Struts class that doesn't extend HttpServletRequestWrapper), return the wrapped request; otherwise, return the given request. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PageFlowUtils()
Method Detail |
---|
public static String getModulePath(HttpServletRequest request, String requestURI)
request
- the current HttpServletRequest.requestURI
- the URI for which to get the Struts module path.public static String getModulePath(HttpServletRequest request)
request
- the current HttpServletRequest.public static String getModulePathForRelativeURI(String uri)
uri
- the URI for which to get the module path.public static String getRelativeURI(HttpServletRequest request, PageFlowController relativeTo)
request
- the current HttpServletRequest.relativeTo
- a PageFlowController to which the returned URI should be relative, or
null
if the returned URI should be relative to the webapp root.public static String getRelativeURI(HttpServletRequest request, String uri, PageFlowController relativeTo)
request
- the current HttpServletRequest.uri
- the URI which should be made relative.relativeTo
- a PageFlowController to which the returned URI should be relative, or
null
if the returned URI should be relative to the webapp root.public static String getBeginActionURI(String requestURI)
public static Stack getPageFlowStack(HttpServletRequest request)
PageFlowStack.get(HttpServletRequest, ServletContext)
instead.
request
- the current HttpServletRequest
PageFlowStack
of nested page flows (PageFlowController
s) for the current user session.public static void destroyPageFlowStack(HttpServletRequest request)
PageFlowStack.destroy(javax.servlet.http.HttpServletRequest)
instead.
PageFlowController
s that have invoked nested page flows.
request
- the current HttpServletRequest.public static PageFlowController getNestingPageFlow(HttpServletRequest request)
getNestingPageFlow(HttpServletRequest, ServletContext)
instead.
PageFlowController
that is nesting the current one.
request
- the current HttpServletRequest.
PageFlowController
, or null
if the current one
is not being nested.public static PageFlowController getNestingPageFlow(HttpServletRequest request, ServletContext servletContext)
PageFlowController
that is nesting the current one.
request
- the current HttpServletRequest.servletContext
- the current ServletContext.
PageFlowController
, or null
if the current one
is not being nested.public static PageFlowController getCurrentPageFlow(HttpServletRequest request, ServletContext servletContext)
PageFlowController
.
request
- the current HttpServletRequest.servletContext
- the current ServletContext.
null
if there is none.public static PageFlowController getCurrentPageFlow(HttpServletRequest request)
getCurrentPageFlow(HttpServletRequest, ServletContext)
instead.
request
- the current HttpServletRequest.
null
if there is none.public static ActionResolver getCurrentActionResolver(HttpServletRequest request)
getCurrentPageFlow(HttpServletRequest, ServletContext)
instead.
null
if there is none.public static ActionResolver getCurrentActionResolver(HttpServletRequest request, ServletContext servletContext)
getCurrentPageFlow(HttpServletRequest, ServletContext)
instead.
request
- the current HttpServletRequest.servletContext
- the current ServletContext.
null
if there is none.public static GlobalApp getGlobalApp(HttpServletRequest request)
getSharedFlow(java.lang.String, javax.servlet.http.HttpServletRequest)
instead.
GlobalApp
instance.
request
- the current HttpServletRequest.
GlobalApp
from the user session, or null
if none
exists.public static Map getSharedFlows(HttpServletRequest request)
sharedFlowRefs
attribute
of the @Jpf.Controller
annotation on the
current page flow.
request
- the current HttpServletRequest, which is used to determine the current page flow.
SharedFlowController
).public static SharedFlowController getSharedFlow(String sharedFlowClassName, HttpServletRequest request)
getSharedFlow(String, HttpServletRequest, ServletContext)
instead.
sharedFlowClassName
- the class name of the shared flow to retrieve.request
- the current HttpServletRequest.
SharedFlowController
of the given class name which is stored in the user session.public static SharedFlowController getSharedFlow(String sharedFlowClassName, HttpServletRequest request, ServletContext servletContext)
sharedFlowClassName
- the class name of the shared flow to retrieve.request
- the current HttpServletRequest.
SharedFlowController
of the given class name which is stored in the user session.public static void removeSharedFlow(String sharedFlowClassName, HttpServletRequest request)
removeSharedFlow(String, HttpServletRequest, ServletContext)
instead.
SharedFlowController
of the given class name.
sharedFlowClassName
- the class name of the current SharedFlowController to destroy.request
- the current HttpServletRequest.public static void removeSharedFlow(String sharedFlowClassName, HttpServletRequest request, ServletContext servletContext)
SharedFlowController
of the given class name.
sharedFlowClassName
- the class name of the current SharedFlowController to destroy.request
- the current HttpServletRequest.public static void removeLongLivedPageFlow(String modulePath, HttpServletRequest request)
removeLongLivedPageFlow(String, HttpServletRequest, ServletContext)
instead.
FlowController.remove()
is
called. Navigating to another page flow hides the current long-lived controller, but does not
remove it.
public static void removeLongLivedPageFlow(String modulePath, HttpServletRequest request, ServletContext servletContext)
FlowController.remove()
is
called. Navigating to another page flow hides the current long-lived controller, but does not
remove it.
public static PageFlowController getLongLivedPageFlow(String modulePath, HttpServletRequest request)
getLongLivedPageFlow(String, HttpServletRequest, ServletContext)
instead.
modulePath
- the webapp-relative path to the directory containing the long-lived page flow.request
- the current HttpServletRequest.
null
if none is found.public static PageFlowController getLongLivedPageFlow(String modulePath, HttpServletRequest request, ServletContext servletContext)
modulePath
- the webapp-relative path to the directory containing the long-lived page flow.request
- the current HttpServletRequest.servletContext
- the current ServletContext.
null
if none is found.public static void setOutputForms(ActionMapping mapping, Forward fwd, HttpServletRequest request, boolean overwrite)
Forward
object available as attributets in the
request/session (as appropriate).
mapping
- the ActionMapping for the current Struts action being processed.fwd
- the Forward
object that contains the ActionForm instances to be
made available in the request/session (as appropriate).request
- the current HttpServletRequest.overwrite
- if false
a form from fwd
will only be set
in the request if there is no existing form with the same name.public static void setOutputForms(ActionMapping mapping, Forward fwd, HttpServletRequest request)
Forward
object available as attributets in the
request/session (as appropriate).
mapping
- the ActionMapping for the current Struts action being processed.fwd
- the Forward
object that contains the ActionForm instances to be
made available in the request/session (as appropriate).request
- the current HttpServletRequest.public static void setOutputForms(ActionMapping mapping, ActionForm[] outputForms, HttpServletRequest request)
mapping
- the ActionMapping for the current Struts action being processed.outputForms
- an array of ActionForm instances to be made available in the
request/session (as appropriate).request
- the current HttpServletRequest.public static void setOutputForms(ActionMapping mapping, ActionForm[] outputForms, HttpServletRequest request, boolean overwrite)
mapping
- the ActionMapping for the current Struts action being processed.outputForms
- an array of ActionForm instances to be made available in the
request/session (as appropriate).overwrite
- if false
a form from fwd
will only be set
in the request if there is no existing form with the same name.request
- the current HttpServletRequest.public static void setOutputForm(ActionMapping mapping, ActionForm form, HttpServletRequest request, boolean overwrite)
mapping
- the ActionMapping for the current Struts action being processed.form
- an ActionForm instance to be made available in the request/session
(as appropriate).overwrite
- if false
a form from fwd
will only be set
in the request if there is no existing form with the same name.request
- the current HttpServletRequest.public static String getFormBeanName(ActionForm formInstance, HttpServletRequest request)
formInstance
- the ActionForm instance whose type will determine the name.request
- the current HttpServletRequest, which contains a reference to the current Struts module.
public static String getFormBeanName(Class formBeanClass, HttpServletRequest request)
formBeanClass
- the ActionForm-derived class whose type will determine the name.request
- the current HttpServletRequest, which contains a reference to the current Struts module.
public static String getPageFlowClassName(String uri)
PageFlowController
, given the URI to it.
uri
- the URI to the PageFlowController
, which should be relative to the
web application root (i.e., it should not include the context path).public static String getJpfClassName(String uri)
getPageFlowClassName(String)
instead.
PageFlowController
, given the URI to it.
uri
- the URI to the PageFlowController
, which should be relative to the
web application root (i.e., it should not include the context path).public static String getPageFlowURI(String className)
PageFlowController
, given its class name.
className
- the name of the PageFlowController
class.
PageFlowController
, relative to the web
application root (i.e., not including the context path).public static String getModuleConfPath(String modulePath)
PageFlowActionServlet.getModuleConfPath(java.lang.String)
instead.
Get the path to the Struts module configration file (e.g.,
"/WEB-INF/classes/_pageflow/struts-config-someModule") for a given module
path (e.g., "someModule"), according to the PageFlow convention.
modulePath
- the Struts module path.
public static String getActionURI(ServletRequest request)
FlowController.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
.
request
- the current ServletRequest.
public static SecurityProtocol getSecurityProtocol(String uri, ServletContext servletContext, HttpServletRequest request)
<security-constraint> <web-resource-collection> <web-resource-name>Secure PageFlow - begin</web-resource-name> <url-pattern>/login/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
uri
- a webapp-relative URI for a resource. There must not be query parameters or a scheme
on the URI.request
- the current request.
Boolean.TRUE
if a transport-guarantee of CONFIDENTIAL
or
INTEGRAL
is associated with the given resource; Boolean.FALSE
a transport-guarantee of NONE
is associated with the given resource; or
null
if there is no transport-guarantee associated with the given resource.public static Boolean isSecureResource(String uri, ServletContext context)
getSecurityProtocol(String, ServletContext, HttpServletRequest)
instead.
public static void addPageInput(String name, Object value, ServletRequest request)
addActionOutput(java.lang.String, java.lang.Object, javax.servlet.ServletRequest)
instead.
pageInput
JSP tag.
The actual value can be read from within a JSP using the "pageInput"
databinding context.
name
- the name of the action output.value
- the value of the action output.request
- the current ServletRequest.public static void addActionOutput(String name, Object value, ServletRequest request)
pageInput
JSP tag.
The actual value can be read from within a JSP using the "pageInput"
databinding context.
name
- the name of the action output.value
- the value of the action output.request
- the current ServletRequest.public static Object getPageInput(String name, ServletRequest request)
getActionOutput(java.lang.String, javax.servlet.ServletRequest)
instead.
name
- the name of the action output.request
- the current ServletRequestaddActionOutput(java.lang.String, java.lang.Object, javax.servlet.ServletRequest)
public static Object getActionOutput(String name, ServletRequest request)
name
- the name of the action output.request
- the current ServletRequestaddActionOutput(java.lang.String, java.lang.Object, javax.servlet.ServletRequest)
public static void addValidationError(String propertyName, String messageKey, Object[] messageArgs, ServletRequest request)
addActionError(ServletRequest, String, String, Object[])
instead.
propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the error message.messageArgs
- an array of arguments for the error message.request
- the current ServletRequest.public static void addValidationError(String propertyName, String messageKey, Object messageArg, ServletRequest request)
addActionError(ServletRequest, String, String, Object[])
instead.
propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the error message.messageArg
- an argument for the error message.request
- the current ServletRequest.public static void addValidationError(String propertyName, String messageKey, ServletRequest request)
addActionError(ServletRequest, String, String, Object[])
instead.
propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the error message.request
- the current ServletRequest.public static void addActionError(ServletRequest request, String propertyName, String messageKey, Object[] messageArgs)
request
- the current ServletRequest.propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the message.messageArgs
- zero or more arguments to the message.public static void addActionError(ServletRequest request, String propertyName, String messageKey)
request
- the current ServletRequest.propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the message.public static void addActionError(ServletRequest request, String propertyName, String messageKey, Object messageArg)
request
- the current ServletRequest.propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the message.messageArg
- an argument to the messagepublic static void addActionError(ServletRequest request, String propertyName, String messageKey, Object messageArg1, Object messageArg2)
request
- the current ServletRequest.propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the message.messageArg1
- the first argument to the messagemessageArg2
- the second argument to the messagepublic static void addActionError(ServletRequest request, String propertyName, String messageKey, Object messageArg1, Object messageArg2, Object messageArg3)
request
- the current ServletRequest.propertyName
- the name of the property with which to associate this error.messageKey
- the message-resources key for the message.messageArg1
- the first argument to the messagemessageArg2
- the second argument to the messagemessageArg3
- the third argument to the messagepublic static void addActionErrorExpression(HttpServletRequest request, String propertyName, String expression, Object[] messageArgs)
request
- the current ServletRequest.propertyName
- the name of the property with which to associate this error.expression
- the JSP 2.0-style expression (e.g., ${pageFlow.myProperty}
) or literal string
that will be used as the message.messageArgs
- zero or more arguments to the message.public static ActionResult strutsLookup(ServletContext context, ServletRequest request, HttpServletResponse response, String actionOverride, String[] autoResolveExtensions) throws Exception
context
- the current ServletContextrequest
- the ServletRequest, which must be a ScopedRequest
.response
- the ServletResponse, which must be a ScopedResponse
.actionOverride
- if not null
, this qualified action-path is used to construct an action
URI which is set as the request URI. The action-path must begin with '/',
which makes it qualified from the webapp root.autoResolveExtensions
- a list of URI extensions (e.g., ".do", ".jpf") that will be auto-resolved, i.e.,
on which this method will be recursively called. If null
, the
default extensions ".do" and ".jpf" will be used.
Exception
public static HttpServletRequest unwrapMultipart(HttpServletRequest request)
public static GlobalApp ensureGlobalApp(HttpServletRequest request, HttpServletResponse response)
getGlobalApp(javax.servlet.http.HttpServletRequest)
instead.
GlobalApp
instance.
request
- the current HttpServletRequest.response
- the current HttpServletResponse
GlobalApp
from the user session, or a newly-instantiated one
(based on the user's Global.app file) if none was in the session. Failing that,
return null
.public static GlobalApp ensureGlobalApp(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
getSharedFlow(java.lang.String, javax.servlet.http.HttpServletRequest)
instead.
GlobalApp
instance.
request
- the current HttpServletRequest.response
- the current HttpServletResponse
GlobalApp
from the user session, or a newly-instantiated one
(based on the user's Global.app file) if none was in the session. Failing that,
return null
.public static Map getBindingUpdateErrors(ServletRequest request)
InternalUtils.getBindingUpdateErrors(javax.servlet.ServletRequest)
can be used, but it is
not guaranteed to be supported in the future.
public static ModuleConfig ensureModuleConfig(String modulePath, ServletRequest request, ServletContext context)
InternalUtils.ensureModuleConfig(java.lang.String, javax.servlet.ServletContext)
can be used, but it is
not guaranteed to be supported in the future.
public static ModuleConfig getGlobalAppConfig(ServletContext servletContext)
public static ModuleConfig getModuleConfig(String modulePath, ServletContext context)
InternalUtils.getModuleConfig(java.lang.String, javax.servlet.ServletContext)
can be used, but it is
not guaranteed to be supported in the future.
public static String getFileExtension(String filename)
FileUtils.getFileExtension(java.lang.String)
instead.
filename
- the file name.
public static String getPageFlowClassName(String modulePath, ServletRequest request, ServletContext context)
InternalUtils.getFlowControllerClassName(java.lang.String, javax.servlet.ServletRequest, javax.servlet.ServletContext)
can be used, but it is
not guaranteed to be supported in the future.
public static boolean ensureAppDeployment(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
public static boolean isAbsoluteURI(String uri)
FileUtils.isAbsoluteURI(java.lang.String)
instead.
uri
- the URI to test.
true
if the given URI is absolute.public static final PageFlowController ensureCurrentPageFlow(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
getCurrentPageFlow(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext)
instead.
public static final PageFlowController ensureCurrentPageFlow(HttpServletRequest request, HttpServletResponse response)
getCurrentPageFlow(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext)
instead.
public static void addBindingUpdateError(ServletRequest request, String expression, String message, Throwable e)
InternalUtils.addBindingUpdateError(javax.servlet.ServletRequest, java.lang.String, java.lang.String, java.lang.Throwable)
can be used, but it is
not guaranteed to be supported in the future.
public static void dumpRequest(HttpServletRequest request, PrintStream output)
ServletUtils.dumpRequest(javax.servlet.ServletRequest, java.io.PrintStream)
can be used, but it is
not guaranteed to be supported in the future.
public static void dumpServletContext(ServletContext context, PrintStream output)
ServletUtils.dumpServletContext(javax.servlet.ServletContext, java.io.PrintStream)
can be used, but it is
not guaranteed to be supported in the future.
public static void preventCache(HttpServletResponse response)
ServletUtils.preventCache(javax.servlet.ServletResponse)
instead.
public static void setCurrentActionResolver(ActionResolver resolver, HttpServletRequest request)
InternalUtils.setCurrentActionResolver(org.apache.beehive.netui.pageflow.ActionResolver, javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext)
can be used, but it is
not guaranteed to be supported in the future. This method will be removed in the next version.
public static MutableURI getActionURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String actionName) throws URISyntaxException
URLRewriterService.rewriteURL(javax.servlet.ServletContext, javax.servlet.ServletRequest, javax.servlet.ServletResponse, org.apache.beehive.netui.core.urls.MutableURI, org.apache.beehive.netui.core.urls.URLType, boolean)
. Use getRewrittenActionURI(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.util.Map, java.lang.String, boolean)
to get a fully-rewritten URI.
servletContext
- the current ServletContext.request
- the current HttpServletRequest.response
- the current HttpServletResponse.actionName
- the action name to convert into a MutableURI; may be qualified with a path from the webapp
root, in which case the parent directory from the current request is not used.
URISyntaxException
- if there is a problem converting the action URI (derived from processing the given
action name) into a MutableURI.public static String getRewrittenActionURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String actionName, Map params, String fragment, boolean forXML) throws URISyntaxException
servletContext
- the current ServletContext.request
- the current HttpServletRequest.response
- the current HttpServletResponse.actionName
- the action name to convert into a fully-rewritten URI; may be qualified with a path from the
webapp root, in which case the parent directory from the current request is not used.params
- the additional parameters to include in the URI query.fragment
- the fragment (anchor or location) for this url.forXML
- flag indicating that the query of the uri should be written
using the "&" entity, rather than the character, '&'.
URISyntaxException
- if there is a problem converting the action URI (derived
from processing the given action name) into a MutableURI.public static String getRewrittenResourceURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String path, Map params, String fragment, boolean forXML) throws URISyntaxException
Calls the rewriter service using a type of URLType.RESOURCE
.
servletContext
- the current ServletContext.request
- the current HttpServletRequest.response
- the current HttpServletResponse.path
- the path to process into a fully-rewritten URI.params
- the additional parameters to include in the URI query.fragment
- the fragment (anchor or location) for this URI.forXML
- flag indicating that the query of the uri should be written
using the "&" entity, rather than the character, '&'.
URISyntaxException
- if there's a problem converting the action URI (derived
from processing the given action name) into a MutableURI.public static String getRewrittenHrefURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String path, Map params, String fragment, boolean forXML) throws URISyntaxException
Calls the rewriter service using a type of URLType.ACTION
.
servletContext
- the current ServletContext.request
- the current HttpServletRequest.response
- the current HttpServletResponse.path
- the path to process into a fully-rewritten URI.params
- the additional parameters to include in the URI query.fragment
- the fragment (anchor or location) for this URI.forXML
- flag indicating that the query of the uri should be written
using the "&" entity, rather than the character, '&'.
URISyntaxException
- if there's a problem converting the action URI (derived
from processing the given action name) into a MutableURI.public static boolean needsToBeSecure(ServletContext context, ServletRequest request, String uri, boolean stripContextPath)
context
- the current ServletContext.request
- the current HttpServletRequest.uri
- the URI to check.stripContextPath
- if true
, strip the webapp context path from the URI before
processing it.
true
when:
SecurityProtocol
), or
ServletRequest.isSecure()
returns
true
).
false
when:
SecurityProtocol
), or
ServletRequest.isSecure()
returns
false
).
public static String getURLTemplateKey(URLType urlType, boolean needsToBeSecure)
urlType
- the type of URL (ACTION, RESOURCE).needsToBeSecure
- indicates that the template should be for a secure URL.
public static URLTemplatesFactory createURLTemplatesFactory(ServletContext servletContext)
DefaultURLTemplatesFactory
. Caller should then set the known
and required tokens, call the URLTemplatesFactory.load(javax.servlet.ServletContext)
method and URLTemplatesFactory.initServletContext(javax.servlet.ServletContext,
org.apache.beehive.netui.core.urltemplates.URLTemplatesFactory)
.
IMPORTANT NOTE - Always try to get the application instance from the ServletContext
by calling URLTemplatesFactory.getURLTemplatesFactory(javax.servlet.ServletContext)
.
Then, if a new URLTemplatesFactory must be created, call this method.
servletContext
-
DefaultURLTemplatesFactory
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |