| java.lang.Object org.apache.beehive.netui.pageflow.PageFlowUtils
Method Summary | |
public 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. | public static void | addActionError(ServletRequest request, String propertyName, String messageKey) Add a property-related message that will be shown with the Errors and Error tags. | public 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. | public 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. | public 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. | public 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. | public 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. | public static void | addBindingUpdateError(ServletRequest request, String expression, String message, Throwable e) | public static void | addPageInput(String name, Object value, ServletRequest request) Set a named action output, which corresponds to an input declared by the pageInput JSP tag. | public static void | addValidationError(String propertyName, String messageKey, Object[] messageArgs, ServletRequest request) Add a validation error that will be shown with the Errors and Error tags. | public static void | addValidationError(String propertyName, String messageKey, Object messageArg, ServletRequest request) Add a validation error that will be shown with the Errors and Error tags. | public static void | addValidationError(String propertyName, String messageKey, ServletRequest request) Add a validation error that will be shown with the Errors and Error tags. | public static URLTemplatesFactory | createURLTemplatesFactory(ServletContext servletContext) Get an uninitialized instance of a container specific URLTemplatesFactory
from the ServletContainerAdapter. | public static void | destroyPageFlowStack(HttpServletRequest request) Destroys the stack of
PageFlowController s that have invoked nested page flows. | public static void | dumpRequest(HttpServletRequest request, PrintStream output) | public static void | dumpServletContext(ServletContext context, PrintStream output) | public static boolean | ensureAppDeployment(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) | final public static PageFlowController | ensureCurrentPageFlow(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) | final public static PageFlowController | ensureCurrentPageFlow(HttpServletRequest request, HttpServletResponse response) | public static GlobalApp | ensureGlobalApp(HttpServletRequest request, HttpServletResponse response) Get or create the current
GlobalApp instance.
PageFlowUtils.getGlobalApp Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse the current GlobalApp from the user session, or a newly-instantiated one(based on the user's Global.app file) if none was in the session. | public static GlobalApp | ensureGlobalApp(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) Get or create the current
GlobalApp instance.
PageFlowUtils.getSharedFlow Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse the current GlobalApp from the user session, or a newly-instantiated one(based on the user's Global.app file) if none was in the session. | public static ModuleConfig | ensureModuleConfig(String modulePath, ServletRequest request, ServletContext context) | public static Object | getActionOutput(String name, ServletRequest request) Get a named action output that was registered in the current request. | public static String | getActionURI(ServletRequest request) Get the most recent action URI that was processed by
FlowController.execute .
Parameters: request - the current ServletRequest. | public 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 . | public static String | getBeginActionURI(String requestURI) Get a URI for the "begin" action in the PageFlowController associated with the given
request URI. | public static Map | getBindingUpdateErrors(ServletRequest request) | public static ActionResolver | getCurrentActionResolver(HttpServletRequest request) Get the current ActionResolver. | public static ActionResolver | getCurrentActionResolver(HttpServletRequest request, ServletContext servletContext) Get the current ActionResolver.
PageFlowUtils.getCurrentPageFlow(HttpServletRequest,ServletContext) Parameters: request - the current HttpServletRequest. Parameters: servletContext - the current ServletContext. | public static PageFlowController | getCurrentPageFlow(HttpServletRequest request, ServletContext servletContext) Get the current
PageFlowController .
Parameters: request - the current HttpServletRequest. Parameters: servletContext - the current ServletContext. | public static PageFlowController | getCurrentPageFlow(HttpServletRequest request) /**
Get the current PageFlowController.
PageFlowUtils.getCurrentPageFlow(HttpServletRequest,ServletContext) Parameters: request - the current HttpServletRequest. | public static String | getFileExtension(String filename) Get the file extension from a file name.
FileUtils.getFileExtension Parameters: filename - the file name. | public static String | getFormBeanName(ActionForm formInstance, HttpServletRequest request) Get the name for the type of a ActionForm instance. | public static String | getFormBeanName(Class formBeanClass, HttpServletRequest request) Get the name for an ActionForm type. | public static GlobalApp | getGlobalApp(HttpServletRequest request) Get the current
GlobalApp instance.
PageFlowUtils.getSharedFlow Parameters: request - the current HttpServletRequest. | public static ModuleConfig | getGlobalAppConfig(ServletContext servletContext) | public static String | getJpfClassName(String uri) Get the class name of a
PageFlowController , given the URI to it. | public static PageFlowController | getLongLivedPageFlow(String modulePath, HttpServletRequest request) Get the long-lived page flow instance associated with the given module (directory) path.
PageFlowUtils.getLongLivedPageFlow(String,HttpServletRequest,ServletContext) Parameters: modulePath - the webapp-relative path to the directory containing the long-lived page flow. Parameters: request - the current HttpServletRequest. | public static PageFlowController | getLongLivedPageFlow(String modulePath, HttpServletRequest request, ServletContext servletContext) Get the long-lived page flow instance associated with the given module (directory) path.
Parameters: modulePath - the webapp-relative path to the directory containing the long-lived page flow. Parameters: request - the current HttpServletRequest. Parameters: servletContext - the current ServletContext. | public static String | getModuleConfPath(String modulePath) PageFlowActionServlet.getModuleConfPath Parameters: modulePath - the Struts module path. | public static ModuleConfig | getModuleConfig(String modulePath, ServletContext context) | public static String | getModulePath(HttpServletRequest request, String requestURI) Get the Struts module path for a URI. | public static String | getModulePath(HttpServletRequest request) Get the Struts module path for the current request URI. | public static String | getModulePathForRelativeURI(String uri) Get the Struts module path for a URI that is relative to the web application root. | public static PageFlowController | getNestingPageFlow(HttpServletRequest request) Get the
PageFlowController that is nesting the current one.
PageFlowUtils.getNestingPageFlow(HttpServletRequest,ServletContext) Parameters: request - the current HttpServletRequest. | public static PageFlowController | getNestingPageFlow(HttpServletRequest request, ServletContext servletContext) Get the
PageFlowController that is nesting the current one.
Parameters: request - the current HttpServletRequest. Parameters: servletContext - the current ServletContext. | public static String | getPageFlowClassName(String uri) Get the class name of a
PageFlowController , given the URI to it. | public static String | getPageFlowClassName(String modulePath, ServletRequest request, ServletContext context) | public static Stack | getPageFlowStack(HttpServletRequest request) Get the stack of nested page flows for the current user session. | public static String | getPageFlowURI(String className) Get the URI for a
PageFlowController , given its class name.
Parameters: className - the name of the PageFlowController class. | public static Object | getPageInput(String name, ServletRequest request) Get a named action output that was registered in the current request. | public static String | getRelativeURI(HttpServletRequest request, PageFlowController relativeTo) Get the request URI, relative to the URI of the given PageFlowController. | public static String | getRelativeURI(HttpServletRequest request, String uri, PageFlowController relativeTo) Get a URI relative to the URI of the given PageFlowController. | public 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.
Parameters: servletContext - the current ServletContext. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. Parameters: actionName - the action name to convert into a fully-rewritten URI; may be qualified with a path from thewebapp root, in which case the parent directory from the current request is not used. Parameters: params - the additional parameters to include in the URI query. Parameters: fragment - the fragment (anchor or location) for this url. Parameters: forXML - flag indicating that the query of the uri should be writtenusing the "&" entity, rather than the character, '&'. | public 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.
Calls the rewriter service using a type of
URLType.ACTION . | public 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.
Calls the rewriter service using a type of
URLType.RESOURCE . | public static SecurityProtocol | getSecurityProtocol(String uri, ServletContext servletContext, HttpServletRequest request) Tell whether a web application resource requires a secure transport protocol. | public static SharedFlowController | getSharedFlow(String sharedFlowClassName, HttpServletRequest request) Get the shared flow with the given class name.
PageFlowUtils.getSharedFlow(String,HttpServletRequest,ServletContext) Parameters: sharedFlowClassName - the class name of the shared flow to retrieve. Parameters: request - the current HttpServletRequest. | public static SharedFlowController | getSharedFlow(String sharedFlowClassName, HttpServletRequest request, ServletContext servletContext) Get the shared flow with the given class name.
Parameters: sharedFlowClassName - the class name of the shared flow to retrieve. Parameters: request - the current HttpServletRequest. | public static Map | getSharedFlows(HttpServletRequest request) Get the a map of shared flow name to shared flow instance, based on the names defined in the
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller.sharedFlowRefs sharedFlowRefs attribute
of the
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller annotation on the
current page flow.
Parameters: request - the current HttpServletRequest, which is used to determine the current page flow. | public 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.
Parameters: urlType - the type of URL (ACTION, RESOURCE). Parameters: needsToBeSecure - indicates that the template should be for a secure URL. | public static boolean | isAbsoluteURI(String uri) Tell whether a given URI is absolute, i.e., whether it contains a scheme-part (e.g., "http:").
FileUtils.isAbsoluteURI Parameters: uri - the URI to test. | static boolean | isPreventCache(ServletRequest request) Internal getter that reports whether this request should prevent caching. | public static Boolean | isSecureResource(String uri, ServletContext context) | public static boolean | needsToBeSecure(ServletContext context, ServletRequest request, String uri, boolean stripContextPath) Tell whether a given URI should be written to be secure.
Parameters: context - the current ServletContext. Parameters: request - the current HttpServletRequest. Parameters: uri - the URI to check. Parameters: stripContextPath - if true , strip the webapp context path from the URI beforeprocessing it. | public static void | preventCache(HttpServletResponse response) | public static void | removeLongLivedPageFlow(String modulePath, HttpServletRequest request) Remove a "long-lived" page flow from the session. | public static void | removeLongLivedPageFlow(String modulePath, HttpServletRequest request, ServletContext servletContext) Remove a "long-lived" page flow from the session. | public static void | removeSharedFlow(String sharedFlowClassName, HttpServletRequest request) Destroy the current
SharedFlowController of the given class name. | public static void | removeSharedFlow(String sharedFlowClassName, HttpServletRequest request, ServletContext servletContext) Destroy the current
SharedFlowController of the given class name. | static void | setActionURI(HttpServletRequest request) Sets the most recent action URI that was processed by
FlowController.execute . | public static void | setCurrentActionResolver(ActionResolver resolver, HttpServletRequest request) | public 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). | public 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). | public 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). | public static void | setOutputForms(ActionMapping mapping, ActionForm[] outputForms, HttpServletRequest request) Make a set of form beans available as attributets in the request/session (as appropriate). | public 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 | setPreventCache(ServletRequest request) Make sure that when this page is rendered, it will set headers in the response to prevent caching.
Because these headers are lost on server forwards, we set a request attribute to cause the headers
to be set right before the page is rendered. | public 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.
Parameters: context - the current ServletContext Parameters: request - the ServletRequest, which must be a ScopedRequest. Parameters: response - the ServletResponse, which must be a ScopedResponse. Parameters: actionOverride - if not null , this qualified action-path is used to construct an actionURI which is set as the request URI. | public 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. |
addActionError | public static void addActionError(ServletRequest request, String propertyName, String messageKey, Object[] messageArgs)(Code) | | Add a property-related message that will be shown with the Errors and Error tags.
Parameters: request - the current ServletRequest. Parameters: propertyName - the name of the property with which to associate this error. Parameters: messageKey - the message-resources key for the message. Parameters: messageArgs - zero or more arguments to the message. |
addActionError | public static void addActionError(ServletRequest request, String propertyName, String messageKey)(Code) | | Add a property-related message that will be shown with the Errors and Error tags.
Parameters: request - the current ServletRequest. Parameters: propertyName - the name of the property with which to associate this error. Parameters: messageKey - the message-resources key for the message. |
addActionError | public static void addActionError(ServletRequest request, String propertyName, String messageKey, Object messageArg)(Code) | | Add a property-related message that will be shown with the Errors and Error tags.
Parameters: request - the current ServletRequest. Parameters: propertyName - the name of the property with which to associate this error. Parameters: messageKey - the message-resources key for the message. Parameters: messageArg - an argument to the message |
addActionError | public static void addActionError(ServletRequest request, String propertyName, String messageKey, Object messageArg1, Object messageArg2)(Code) | | Add a property-related message that will be shown with the Errors and Error tags.
Parameters: request - the current ServletRequest. Parameters: propertyName - the name of the property with which to associate this error. Parameters: messageKey - the message-resources key for the message. Parameters: messageArg1 - the first argument to the message Parameters: messageArg2 - the second argument to the message |
addActionError | public static void addActionError(ServletRequest request, String propertyName, String messageKey, Object messageArg1, Object messageArg2, Object messageArg3)(Code) | | Add a property-related message that will be shown with the Errors and Error tags.
Parameters: request - the current ServletRequest. Parameters: propertyName - the name of the property with which to associate this error. Parameters: messageKey - the message-resources key for the message. Parameters: messageArg1 - the first argument to the message Parameters: messageArg2 - the second argument to the message Parameters: messageArg3 - the third argument to the message |
addActionErrorExpression | public static void addActionErrorExpression(HttpServletRequest request, String propertyName, String expression, Object[] messageArgs)(Code) | | Add a property-related message as an expression that will be evaluated and shown with the Errors and Error tags.
Parameters: request - the current ServletRequest. Parameters: propertyName - the name of the property with which to associate this error. Parameters: expression - the JSP 2.0-style expression (e.g., ${pageFlow.myProperty} ) or literal stringthat will be used as the message. Parameters: messageArgs - zero or more arguments to the message. |
addActionOutput | public static void addActionOutput(String name, Object value, ServletRequest request)(Code) | | Set a named action output, which corresponds to an input declared by the pageInput JSP tag.
The actual value can be read from within a JSP using the "pageInput" databinding context.
Parameters: name - the name of the action output. Parameters: value - the value of the action output. Parameters: request - the current ServletRequest. |
addPageInput | public static void addPageInput(String name, Object value, ServletRequest request)(Code) | | Set a named action output, which corresponds to an input declared by the pageInput JSP tag.
The actual value can be read from within a JSP using the "pageInput" databinding context.
PageFlowUtils.addActionOutput Parameters: name - the name of the action output. Parameters: value - the value of the action output. Parameters: request - the current ServletRequest. |
addValidationError | public static void addValidationError(String propertyName, String messageKey, Object[] messageArgs, ServletRequest request)(Code) | | Add a validation error that will be shown with the Errors and Error tags.
PageFlowUtils.addActionError(ServletRequest,String,String,Object[]) Parameters: propertyName - the name of the property with which to associate this error. Parameters: messageKey - the message-resources key for the error message. Parameters: messageArgs - an array of arguments for the error message. Parameters: request - the current ServletRequest. |
addValidationError | public static void addValidationError(String propertyName, String messageKey, Object messageArg, ServletRequest request)(Code) | | Add a validation error that will be shown with the Errors and Error tags.
PageFlowUtils.addActionError(ServletRequest,String,String,Object[]) Parameters: propertyName - the name of the property with which to associate this error. Parameters: messageKey - the message-resources key for the error message. Parameters: messageArg - an argument for the error message. Parameters: request - the current ServletRequest. |
getActionURI | public static String getActionURI(ServletRequest request)(Code) | | Get the most recent action URI that was processed by
FlowController.execute .
Parameters: request - the current ServletRequest. a String that is the most recent action URI. This is only valid during a requestthat has been forwarded from the action URI. |
getActionURI | public static MutableURI getActionURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String actionName) throws URISyntaxException(Code) | | Create a raw action URI, which can be modified before being sent through the registered URL rewriting chain
using
URLRewriterService.rewriteURL . Use
PageFlowUtils.getRewrittenActionURI to get a fully-rewritten URI.
Parameters: servletContext - the current ServletContext. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. Parameters: actionName - the action name to convert into a MutableURI; may be qualified with a path from the webapproot, in which case the parent directory from the current request is not used. a MutableURI for the given action, suitable for URL rewriting. throws: URISyntaxException - if there is a problem converting the action URI (derived from processing the givenaction name) into a MutableURI. |
getBeginActionURI | public static String getBeginActionURI(String requestURI)(Code) | | Get a URI for the "begin" action in the PageFlowController associated with the given
request URI.
a String that is the URI for the "begin" action in the PageFlowController associatedwith the given request URI. |
getFileExtension | public static String getFileExtension(String filename)(Code) | | Get the file extension from a file name.
FileUtils.getFileExtension Parameters: filename - the file name. the file extension (everything after the last '.'), or the empty string if there is no file extension. |
getFormBeanName | public static String getFormBeanName(ActionForm formInstance, HttpServletRequest request)(Code) | | Get the name for the type of a ActionForm instance. Use a name looked up from
the current Struts module, or, if none is found, create one.
Parameters: formInstance - the ActionForm instance whose type will determine the name. Parameters: request - the current HttpServletRequest, which contains a reference to the current Struts module. the name found in the Struts module, or, if none is found, a name that is either:- a camel-cased version of the base class name (minus any package or outer-classqualifiers, or, if that name is already taken,
- the full class name, with '.' and '$' replaced by '_'.
|
getFormBeanName | public static String getFormBeanName(Class formBeanClass, HttpServletRequest request)(Code) | | Get the name for an ActionForm type. Use a name looked up from the current Struts module, or,
if none is found, create one.
Parameters: formBeanClass - the ActionForm-derived class whose type will determine the name. Parameters: request - the current HttpServletRequest, which contains a reference to the current Struts module. the name found in the Struts module, or, if none is found, a name that is either:- a camel-cased version of the base class name (minus any package or outer-classqualifiers, or, if that name is already taken,
- the full class name, with '.' and '$' replaced by '_'.
|
getGlobalAppConfig | public static ModuleConfig getGlobalAppConfig(ServletContext servletContext)(Code) | | |
getLongLivedPageFlow | public static PageFlowController getLongLivedPageFlow(String modulePath, HttpServletRequest request, ServletContext servletContext)(Code) | | Get the long-lived page flow instance associated with the given module (directory) path.
Parameters: modulePath - the webapp-relative path to the directory containing the long-lived page flow. Parameters: request - the current HttpServletRequest. Parameters: servletContext - the current ServletContext. the long-lived page flow instance associated with the given module, or null if none is found. |
getModulePath | public static String getModulePath(HttpServletRequest request, String requestURI)(Code) | | Get the Struts module path for a URI. This is the parent directory, relative to the web
application root, of the file referenced by the URI.
Parameters: request - the current HttpServletRequest. Parameters: requestURI - the URI for which to get the Struts module path. |
getModulePath | public static String getModulePath(HttpServletRequest request)(Code) | | Get the Struts module path for the current request URI. This is the parent directory,
relative to the web application root, of the file referenced by the request URI.
Parameters: request - the current HttpServletRequest. |
getModulePathForRelativeURI | public static String getModulePathForRelativeURI(String uri)(Code) | | Get the Struts module path for a URI that is relative to the web application root.
Parameters: uri - the URI for which to get the module path. |
getPageFlowClassName | public static String getPageFlowClassName(String uri)(Code) | | Get the class name of a
PageFlowController , given the URI to it.
Parameters: uri - the URI to the PageFlowController, which should be relative to theweb application root (i.e., it should not include the context path). |
getRelativeURI | public static String getRelativeURI(HttpServletRequest request, PageFlowController relativeTo)(Code) | | Get the request URI, relative to the URI of the given PageFlowController.
Parameters: request - the current HttpServletRequest. Parameters: relativeTo - a PageFlowController to which the returned URI should be relative, ornull if the returned URI should be relative to the webapp root. |
getRelativeURI | public static String getRelativeURI(HttpServletRequest request, String uri, PageFlowController relativeTo)(Code) | | Get a URI relative to the URI of the given PageFlowController.
Parameters: request - the current HttpServletRequest. Parameters: uri - the URI which should be made relative. Parameters: relativeTo - a PageFlowController to which the returned URI should be relative, ornull if the returned URI should be relative to the webapp root. |
getRewrittenActionURI | public static String getRewrittenActionURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String actionName, Map params, String fragment, boolean forXML) throws URISyntaxException(Code) | | Create a fully-rewritten URI given an action name and parameters.
Parameters: servletContext - the current ServletContext. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. Parameters: actionName - the action name to convert into a fully-rewritten URI; may be qualified with a path from thewebapp root, in which case the parent directory from the current request is not used. Parameters: params - the additional parameters to include in the URI query. Parameters: fragment - the fragment (anchor or location) for this url. Parameters: forXML - flag indicating that the query of the uri should be writtenusing the "&" entity, rather than the character, '&'. a fully-rewritten URI for the given action. throws: URISyntaxException - if there is a problem converting the action URI (derivedfrom processing the given action name) into a MutableURI. |
getRewrittenHrefURI | public static String getRewrittenHrefURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String path, Map params, String fragment, boolean forXML) throws URISyntaxException(Code) | | Create a fully-rewritten URI given a path and parameters.
Calls the rewriter service using a type of
URLType.ACTION .
Parameters: servletContext - the current ServletContext. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. Parameters: path - the path to process into a fully-rewritten URI. Parameters: params - the additional parameters to include in the URI query. Parameters: fragment - the fragment (anchor or location) for this URI. Parameters: forXML - flag indicating that the query of the uri should be writtenusing the "&" entity, rather than the character, '&'. a fully-rewritten URI for the given action. throws: URISyntaxException - if there's a problem converting the action URI (derivedfrom processing the given action name) into a MutableURI. |
getRewrittenResourceURI | public static String getRewrittenResourceURI(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, String path, Map params, String fragment, boolean forXML) throws URISyntaxException(Code) | | Create a fully-rewritten URI given a path and parameters.
Calls the rewriter service using a type of
URLType.RESOURCE .
Parameters: servletContext - the current ServletContext. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. Parameters: path - the path to process into a fully-rewritten URI. Parameters: params - the additional parameters to include in the URI query. Parameters: fragment - the fragment (anchor or location) for this URI. Parameters: forXML - flag indicating that the query of the uri should be writtenusing the "&" entity, rather than the character, '&'. a fully-rewritten URI for the given action. throws: URISyntaxException - if there's a problem converting the action URI (derivedfrom processing the given action name) into a MutableURI. |
getSecurityProtocol | public static SecurityProtocol getSecurityProtocol(String uri, ServletContext servletContext, HttpServletRequest request)(Code) | | Tell whether a web application resource requires a secure transport protocol. This is
determined from web.xml; for example, the following block specifies that all resources under
/login require a secure transport protocol.
<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>
Parameters: uri - a webapp-relative URI for a resource. There must not be query parameters or a schemeon the URI. Parameters: request - the current request. Boolean.TRUE if a transport-guarantee of CONFIDENTIAL orINTEGRAL is associated with the given resource; Boolean.FALSE a transport-guarantee of NONE is associated with the given resource; ornull if there is no transport-guarantee associated with the given resource. |
getSharedFlow | public static SharedFlowController getSharedFlow(String sharedFlowClassName, HttpServletRequest request, ServletContext servletContext)(Code) | | Get the shared flow with the given class name.
Parameters: sharedFlowClassName - the class name of the shared flow to retrieve. Parameters: request - the current HttpServletRequest. the SharedFlowController of the given class name which is stored in the user session. |
getSharedFlows | public static Map getSharedFlows(HttpServletRequest request)(Code) | | Get the a map of shared flow name to shared flow instance, based on the names defined in the
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller.sharedFlowRefs sharedFlowRefs attribute
of the
org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller annotation on the
current page flow.
Parameters: request - the current HttpServletRequest, which is used to determine the current page flow. a Map of shared flow name (string) to shared flow instance (SharedFlowController). |
getURLTemplateKey | public static String getURLTemplateKey(URLType urlType, boolean needsToBeSecure)(Code) | | Returns a key for the URL template type given the URL type and a
flag indicating a secure URL or not.
Parameters: urlType - the type of URL (ACTION, RESOURCE). Parameters: needsToBeSecure - indicates that the template should be for a secure URL. the key/type of template to use. |
isAbsoluteURI | public static boolean isAbsoluteURI(String uri)(Code) | | Tell whether a given URI is absolute, i.e., whether it contains a scheme-part (e.g., "http:").
FileUtils.isAbsoluteURI Parameters: uri - the URI to test. true if the given URI is absolute. |
needsToBeSecure | public static boolean needsToBeSecure(ServletContext context, ServletRequest request, String uri, boolean stripContextPath)(Code) | | Tell whether a given URI should be written to be secure.
Parameters: context - the current ServletContext. Parameters: request - the current HttpServletRequest. Parameters: uri - the URI to check. Parameters: stripContextPath - if true , strip the webapp context path from the URI beforeprocessing it. true when:- the given URI is configured in the deployment descriptor to be secure (according toSecurityProtocol), or
- the given URI is not configured in the deployment descriptor, and the current requestis secure (HttpServletRequest.isSecure returns
true ).
false when:- the given URI is configured explicitly in the deployment descriptor to be unsecure(according to SecurityProtocol), or
- the given URI is not configured in the deployment descriptor, and the current requestis unsecure (HttpServletRequest.isSecure returns
false ).
|
removeLongLivedPageFlow | public static void removeLongLivedPageFlow(String modulePath, HttpServletRequest request, ServletContext servletContext)(Code) | | Remove a "long-lived" page flow from the session. Once it is created, a long-lived page flow
is never removed from the session unless this method or
PageFlowController.remove is
called. Navigating to another page flow hides the current long-lived controller, but does not
remove it.
|
removeSharedFlow | public static void removeSharedFlow(String sharedFlowClassName, HttpServletRequest request, ServletContext servletContext)(Code) | | Destroy the current
SharedFlowController of the given class name.
Parameters: sharedFlowClassName - the class name of the current SharedFlowController to destroy. Parameters: request - the current HttpServletRequest. |
setOutputForm | public static void setOutputForm(ActionMapping mapping, ActionForm form, HttpServletRequest request, boolean overwrite)(Code) | | Make a form bean available as an attributet in the request/session (as appropriate).
Parameters: mapping - the ActionMapping for the current Struts action being processed. Parameters: form - an ActionForm instance to be made available in the request/session(as appropriate). Parameters: overwrite - if false a form from fwd will only be setin the request if there is no existing form with the same name. Parameters: request - the current HttpServletRequest. |
setOutputForms | public static void setOutputForms(ActionMapping mapping, Forward fwd, HttpServletRequest request, boolean overwrite)(Code) | | Make any form beans in the given
Forward object available as attributets in the
request/session (as appropriate).
Parameters: mapping - the ActionMapping for the current Struts action being processed. Parameters: fwd - the Forward object that contains the ActionForm instances to bemade available in the request/session (as appropriate). Parameters: request - the current HttpServletRequest. Parameters: overwrite - if false a form from fwd will only be setin the request if there is no existing form with the same name. |
setOutputForms | public static void setOutputForms(ActionMapping mapping, Forward fwd, HttpServletRequest request)(Code) | | Make any form beans in the given
Forward object available as attributets in the
request/session (as appropriate).
Parameters: mapping - the ActionMapping for the current Struts action being processed. Parameters: fwd - the Forward object that contains the ActionForm instances to bemade available in the request/session (as appropriate). Parameters: request - the current HttpServletRequest. |
setOutputForms | public static void setOutputForms(ActionMapping mapping, ActionForm[] outputForms, HttpServletRequest request)(Code) | | Make a set of form beans available as attributets in the request/session (as appropriate).
Parameters: mapping - the ActionMapping for the current Struts action being processed. Parameters: outputForms - an array of ActionForm instances to be made available in therequest/session (as appropriate). Parameters: request - the current HttpServletRequest. |
setOutputForms | public static void setOutputForms(ActionMapping mapping, ActionForm[] outputForms, HttpServletRequest request, boolean overwrite)(Code) | | Make a set of form beans available as attributets in the request/session (as appropriate).
Parameters: mapping - the ActionMapping for the current Struts action being processed. Parameters: outputForms - an array of ActionForm instances to be made available in therequest/session (as appropriate). Parameters: overwrite - if false a form from fwd will only be setin the request if there is no existing form with the same name. Parameters: request - the current HttpServletRequest. |
setPreventCache | static void setPreventCache(ServletRequest request)(Code) | | Make sure that when this page is rendered, it will set headers in the response to prevent caching.
Because these headers are lost on server forwards, we set a request attribute to cause the headers
to be set right before the page is rendered. This attribute can be read via
PageFlowUtils.isPreventCache(javax.servlet.ServletRequest) .
Parameters: request - the servlet request |
strutsLookup | public static ActionResult strutsLookup(ServletContext context, ServletRequest request, HttpServletResponse response, String actionOverride, String[] autoResolveExtensions) throws Exception(Code) | | Resolve the given action to a URI by running an entire request-processing cycle on the given ScopedRequest
and ScopedResponse.
Parameters: context - the current ServletContext Parameters: request - the ServletRequest, which must be a ScopedRequest. Parameters: response - the ServletResponse, which must be a ScopedResponse. Parameters: actionOverride - if not null , this qualified action-path is used to construct an actionURI which is set as the request URI. The action-path must begin with '/',which makes it qualified from the webapp root. Parameters: 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 , thedefault extensions ".do" and ".jpf" will be used. |
unwrapMultipart | public static HttpServletRequest unwrapMultipart(HttpServletRequest request)(Code) | | If the given request is a MultipartRequestWrapper (Struts class that doesn't extend
HttpServletRequestWrapper), return the wrapped request; otherwise, return the given request.
|
|
|