|
© 2001 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.p13n.appflow.webflow.WebflowJSPHelper
WebflowJSPHelper
provides utility methods needed by
JSP's when working with webflow and pipeline.
Field Summary | |
static int |
CALCULATE_HTTPS
An HTTPSFlag value to be used in createWebflowURL. |
static java.lang.String |
DEFAULT_HTTP_PORT
If the http port = DEFAULT_HTTP_PORT (80) it will not include it in the URL |
static java.lang.String |
DEFAULT_HTTPS_PORT
If the https port = DEFAULT_HTTPS_PORT (443) it will not include it in the URL |
static java.lang.String |
P13N_APPLICATION_URL_DEFAULT
The default servlet path information for webflow. |
static java.lang.String |
P13N_APPLICATION_URL_ELEMENT_NAME
The name of the initialization parameter that specifies a the servlet path for the webflow servlet in this webapp. |
static java.lang.String |
P13N_STATIC_ROOT_ELEMENT_NAME
The name of the initialization parameter that specifies the path to static resources for the webflow URLs. |
static java.lang.String |
P13N_URL_DOMAIN_NAME
The name of the context parameter that specifies a domain name for the URL in cases where Apache is fronting a webflow app. |
static java.lang.String |
P13N_URL_PREFIX_ELEMENT_NAME
The name of the context parameter that specifies a prefix for the URL in cases where Apache is fronting a webflow app. |
static int |
USE_HTTP
An HTTPSFlag value to be used in createWebflowURL. |
static int |
USE_HTTPS
An HTTPSFlag value to be used in createWebflowURL. |
static int |
USE_WEBAPP_DEFAULT_HTTPS
An HTTPSFlag value to be used in createWebflowURL. |
Constructor Summary | |
WebflowJSPHelper()
|
Method Summary | |
static java.lang.String |
createStaticResourceURL(javax.servlet.jsp.PageContext pageContext,
java.lang.String url,
boolean encode)
Returns a URL for images and other static resources that may exist on a seperate server. |
static java.lang.String |
createWebflowURL(javax.servlet.jsp.PageContext pageContext,
java.lang.String origin,
java.lang.String event,
boolean includeParameters)
Returns a URL for Webflow. |
static java.lang.String |
createWebflowURL(javax.servlet.jsp.PageContext pageContext,
java.lang.String namespace,
java.lang.String origin,
java.lang.String event,
boolean includeParameters)
Returns a URL for Webflow. |
static java.lang.String |
createWebflowURL(javax.servlet.jsp.PageContext pageContext,
java.lang.String namespace,
java.lang.String origin,
java.lang.String event,
java.lang.String urlSuffix,
java.lang.String extraParams,
boolean includeParameters,
boolean doRedirect)
Returns a URL for Webflow. |
static java.lang.String |
createWebflowURL(javax.servlet.jsp.PageContext pageContext,
java.lang.String namespace,
java.lang.String origin,
java.lang.String event,
java.lang.String urlSuffix,
java.lang.String extraParams,
boolean includeParameters,
boolean doRedirect,
boolean encode)
Returns a URL for Webflow. |
static java.lang.String |
createWebflowURL(javax.servlet.jsp.PageContext pageContext,
java.lang.String namespace,
java.lang.String origin,
java.lang.String event,
java.lang.String urlSuffix,
java.lang.String extraParams,
boolean includeParameters,
boolean doRedirect,
boolean encode,
int HTTPSFlag)
Returns a URL for Webflow. |
static java.lang.String |
createWebflowURL(javax.servlet.jsp.PageContext pageContext,
java.lang.String namespace,
java.lang.String origin,
java.lang.String event,
java.lang.String urlSuffix,
java.lang.String extraParams,
java.lang.String urlPrefix,
java.lang.String domainName,
boolean includeParameters,
boolean doRedirect,
boolean encode,
int HTTPSFlag)
Returns a URL for Webflow. |
static java.lang.String |
createWebflowURL(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String namespace,
java.lang.String origin,
java.lang.String event,
java.lang.String urlSuffix,
java.lang.String extraParams,
boolean includeParameters,
boolean doRedirect,
boolean encode,
int HTTPSFlag)
Returns a URL for Webflow. |
static java.lang.String |
createWebflowURL(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String namespace,
java.lang.String origin,
java.lang.String event,
java.lang.String urlSuffix,
java.lang.String extraParams,
java.lang.String urlPrefix,
java.lang.String domainName,
boolean includeParameters,
boolean doRedirect,
boolean encode,
int HTTPSFlag)
Returns a URL for Webflow. |
static java.lang.String |
encodeURL(javax.servlet.http.HttpServletResponse response,
java.lang.String url)
Encodes a given URL string using response.encodeURL(). |
static java.lang.String |
getDefaultWebflowNamespace(javax.servlet.jsp.PageContext pageContext)
Gets the name of the default namespace. |
static java.lang.String |
priceFormat(double price)
Deprecated. |
static java.lang.String |
quantityFormat(double quantity)
Deprecated. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String P13N_URL_PREFIX_ELEMENT_NAME
public static final java.lang.String P13N_URL_DOMAIN_NAME
public static final java.lang.String P13N_APPLICATION_URL_ELEMENT_NAME
public static final java.lang.String P13N_APPLICATION_URL_DEFAULT
public static final java.lang.String P13N_STATIC_ROOT_ELEMENT_NAME
public static final int CALCULATE_HTTPS
public static final int USE_HTTP
public static final int USE_HTTPS
public static final int USE_WEBAPP_DEFAULT_HTTPS
public static final java.lang.String DEFAULT_HTTP_PORT
public static final java.lang.String DEFAULT_HTTPS_PORT
Constructor Detail |
public WebflowJSPHelper()
Method Detail |
public static java.lang.String encodeURL(javax.servlet.http.HttpServletResponse response, java.lang.String url)
request
- HttpServletResponse object.public static java.lang.String createWebflowURL(javax.servlet.jsp.PageContext pageContext, java.lang.String origin, java.lang.String event, boolean includeParameters) throws javax.servlet.jsp.JspException
Note: this method assumes redirect = false, HTTPSFlag = USE_WEBAPP_DEFAULT_HTTPS and encode = true
pageContext
- The PageContext object from the JSP.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.includeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.public static java.lang.String createWebflowURL(javax.servlet.jsp.PageContext pageContext, java.lang.String namespace, java.lang.String origin, java.lang.String event, boolean includeParameters) throws javax.servlet.jsp.JspException
Note: this method assumes redirect = false, HTTPSFlag = USE_WEBAPP_DEFAULT_HTTPS and encode = true
pageContext
- The PageContext object from the JSP.namespace
- a String containing the webflow namespace that the
origin belongs to. If this
is null, the webflow engine will assume the
namespace of the destination of the last webflow
execution for this HttpSession. If that does not
exist, the web app's default namespace is used.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.includeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.public static java.lang.String createWebflowURL(javax.servlet.jsp.PageContext pageContext, java.lang.String namespace, java.lang.String origin, java.lang.String event, java.lang.String urlSuffix, java.lang.String extraParams, boolean includeParameters, boolean doRedirect) throws javax.servlet.jsp.JspException
Note: this method assumes HTTPSFlag = USE_WEBAPP_DEFAULT_HTTPS and encode = true
pageContext
- The PageContext object from the JSP.namespace
- a String containing the webflow namespace that the
origin belongs to. If this
is null, the webflow engine will assume the
namespace of the destination of the last webflow
execution for this HttpSession. If that does not
exist, the web app's default namespace is used.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.urlSuffix
- a String, that can contain extra relative path info
that will be added to the URL after the servlet path
and before the parameters. Pass null
if you have no additional path information.extraParams
- a String, that can contain extra parameters to add to
the URL after the servlet path information. Do not
prepend a '&' or '?' to the String, the method will
do that for you. You should pass a String of
the form "param=value¶m2=value2...". Pass null
if you have no additional parameters.includeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.doRedirect
- a boolean, if true add param to URL to signal
webflow to redirect and not forward to the URLpublic static java.lang.String createWebflowURL(javax.servlet.jsp.PageContext pageContext, java.lang.String namespace, java.lang.String origin, java.lang.String event, java.lang.String urlSuffix, java.lang.String extraParams, boolean includeParameters, boolean doRedirect, boolean encode) throws javax.servlet.jsp.JspException
Note: this method assumes HTTPSFlag = USE_WEBAPP_DEFAULT_HTTPS
pageContext
- The PageContext object from the JSP.namespace
- a String containing the webflow namespace that the
origin belongs to. If this
is null, the webflow engine will assume the
namespace of the destination of the last webflow
execution for this HttpSession. If that does not
exist, the web app's default namespace is used.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.urlSuffix
- a String, that can contain extra relative path info
that will be added to the URL after the servlet path
and before the parameters. Pass null
if you have no additional path information.extraParams
- a String, that can contain extra parameters to add to
the URL after the servlet path information. Do not
prepend a '&' or '?' to the String, the method will
do that for you. You should pass a String of
the form "param=value¶m2=value2...". Pass null
if you have no additional parameters.includeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.doRedirect
- a boolean, if true add param to URL to signal
webflow to redirect and not forward to the URLencode
- a boolean, if true, this method will encode the resultant URL
before returning it, using HttpServletResponse.encode().
This will add the session identifier to the URL if
it is required for this client. This should usually
true.public static java.lang.String createWebflowURL(javax.servlet.jsp.PageContext pageContext, java.lang.String namespace, java.lang.String origin, java.lang.String event, java.lang.String urlSuffix, java.lang.String extraParams, boolean includeParameters, boolean doRedirect, boolean encode, int HTTPSFlag) throws javax.servlet.jsp.JspException
pageContext
- The PageContext object from the JSP.namespace
- a String containing the webflow namespace that the
origin belongs to. If this
is null, the webflow engine will assume the
namespace of the destination of the last webflow
execution for this HttpSession. If that does not
exist, the web app's default namespace is used.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.urlSuffix
- a String, that can contain extra relative path info
that will be added to the URL after the servlet path
and before the parameters. Pass null
if you have no additional path information.extraParams
- a String, that can contain extra parameters to add to
the URL after the servlet path information. Do not
prepend a '&' or '?' to the String, the method will
do that for you. You should pass a String of
the form "param=value¶m2=value2...". Pass null
if you have no additional parameters.includeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.doRedirect
- a boolean, if true add param to URL to signal
webflow to redirect and not forward to the URLencode
- a boolean, if true, this method will encode the resultant URL
before returning it, using HttpServletResponse.encode().
This will add the session identifier to the URL if
it is required for this client. This should usually
true.HTTPSFlag
- an int that can be USE_HTTP, USE_HTTPS,
CALCULATE_HTTPS, or USE_WEBAPP_DEFAULT_HTTPS.
USE_WEBAPP_DEFAULT_HTTPS is new with 4.0SP2,
and is the default as of 4.0SP2. Using this value
indicates that the value for this parameter be
taken from the HTTPSIND_DEFAULT_VALUE context
parameter in web.xml (or CALCULATE_HTTPS if not
specified in web.xml).
The default for 4.0 and 4.0SP1 is CALCULATE_HTTPS.
If you do not wish for WebflowJSPHelper to calculate
whether HTTPS is required for this URL,
you may specify whether
or not HTTPS should be used. Note that HTTP is
the normal choice, but if any dependent Inputprocessor
or PipelineComponent needs HTTPS and HTTP is specified
here, a configuration error will result. If you are
unsure of which to use or wish to uphold maintainability,
specify CALCULATE_HTTPS and rely on Webflow to
calculate this for you.public static java.lang.String createWebflowURL(javax.servlet.jsp.PageContext pageContext, java.lang.String namespace, java.lang.String origin, java.lang.String event, java.lang.String urlSuffix, java.lang.String extraParams, java.lang.String urlPrefix, java.lang.String domainName, boolean includeParameters, boolean doRedirect, boolean encode, int HTTPSFlag) throws javax.servlet.jsp.JspException
pageContext
- The PageContext object from the JSP.namespace
- a String containing the webflow namespace that the
origin belongs to. If this
is null, the webflow engine will assume the
namespace of the destination of the last webflow
execution for this HttpSession. If that does not
exist, the web app's default namespace is used.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.urlSuffix
- a String, that can contain extra relative path info
that will be added to the URL after the servlet path
and before the parameters. Pass null
if you have no additional path information.extraParams
- a String, that can contain extra parameters to add to
the URL after the servlet path information. Do not
prepend a '&' or '?' to the String, the method will
do that for you. You should pass a String of
the form "param=value¶m2=value2...". Pass null
if you have no additional parameters.urlPrefix
- An optional prefix that can be supplied to the servlet
path information, if non null this can overridie the
"P13N_URL_PREFIX" in the web.xml.domainName
- An optional parameter that can be used to specify a different domain
name. this is used when a proxy is located on another server. If non
null this will overrid the "P13N_URL_DOMAIN" in the web.xmlincludeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.doRedirect
- a boolean, if true add param to URL to signal
webflow to redirect and not forward to the URLencode
- a boolean, if true, this method will encode the resultant URL
before returning it, using HttpServletResponse.encode().
This will add the session identifier to the URL if
it is required for this client. This should usually
true.HTTPSFlag
- an int that can be USE_HTTP, USE_HTTPS,
CALCULATE_HTTPS, or USE_WEBAPP_DEFAULT_HTTPS.
USE_WEBAPP_DEFAULT_HTTPS is new with 4.0SP2,
and is the default as of 4.0SP2. Using this value
indicates that the value for this parameter be
taken from the HTTPSIND_DEFAULT_VALUE context
parameter in web.xml (or CALCULATE_HTTPS if not
specified in web.xml).
The default for 4.0 and 4.0SP1 is CALCULATE_HTTPS.
If you do not wish for WebflowJSPHelper to calculate
whether HTTPS is required for this URL,
you may specify whether
or not HTTPS should be used. Note that HTTP is
the normal choice, but if any dependent Inputprocessor
or PipelineComponent needs HTTPS and HTTP is specified
here, a configuration error will result. If you are
unsure of which to use or wish to uphold maintainability,
specify CALCULATE_HTTPS and rely on Webflow to
calculate this for you.public static java.lang.String createWebflowURL(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String namespace, java.lang.String origin, java.lang.String event, java.lang.String urlSuffix, java.lang.String extraParams, boolean includeParameters, boolean doRedirect, boolean encode, int HTTPSFlag)
context
- The ServletContext object from the container.request
- The HttpServletRequest objectresponse
- The HttpServletResponse objectnamespace
- a String containing the webflow namespace that the
origin belongs to. If this
is null, the webflow engine will assume the
namespace of the destination of the last webflow
execution for this HttpSession. If that does not
exist, the web app's default namespace is used.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.urlSuffix
- a String, that can contain extra relative path info
that will be added to the URL after the servlet path
and before the parameters. Pass null. Also known as urlSuffix
if you have no additional path information.extraParams
- a String, that can contain extra parameters to add to
the URL after the servlet path information. Do not
prepend a '&' or '?' to the String, the method will
do that for you. You should pass a String of
the form "param=value¶m2=value2...". Pass null
if you have no additional parameters.includeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.doRedirect
- a boolean, if true add param to URL to signal
webflow to redirect and not forward to the URLencode
- a boolean, if true, this method will encode the resultant URL
before returning it, using HttpServletResponse.encode().
This will add the session identifier to the URL if
it is required for this client. This should usually
true.HTTPSFlag
- an int that can be USE_HTTP, USE_HTTPS,
CALCULATE_HTTPS, or USE_WEBAPP_DEFAULT_HTTPS.
USE_WEBAPP_DEFAULT_HTTPS is new with 4.0SP2,
and is the default as of 4.0SP2. Using this value
indicates that the value for this parameter be
taken from the HTTPSIND_DEFAULT_VALUE context
parameter in web.xml (or CALCULATE_HTTPS if not
specified in web.xml).
The default for 4.0 and 4.0SP1 is CALCULATE_HTTPS.
If you do not wish for WebflowJSPHelper to calculate
whether HTTPS is required for this URL,
you may specify whether
or not HTTPS should be used. Note that HTTP is
the normal choice, but if any dependent Inputprocessor
or PipelineComponent needs HTTPS and HTTP is specified
here, a configuration error will result. If you are
unsure of which to use or wish to uphold maintainability,
specify CALCULATE_HTTPS and rely on Webflow to
calculate this for you.public static java.lang.String createWebflowURL(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String namespace, java.lang.String origin, java.lang.String event, java.lang.String urlSuffix, java.lang.String extraParams, java.lang.String urlPrefix, java.lang.String domainName, boolean includeParameters, boolean doRedirect, boolean encode, int HTTPSFlag)
context
- The ServletContext object from the container.request
- The HttpServletRequest objectresponse
- The HttpServletResponse objectnamespace
- a String containing the webflow namespace that the
origin belongs to. If this
is null, the webflow engine will assume the
namespace of the destination of the last webflow
execution for this HttpSession. If that does not
exist, the web app's default namespace is used.origin
- a String containing the origin of the webflow event.
If this is null, the origin is assumed to be
"begin" by the webflow engine.event
- a String containing the webflow event to be used.
This parameter is required, unless origin =
"begin", in which case it is ignored and can be null.urlSuffix
- a String, that can contain extra relative path info
that will be added to the URL after the servlet path
and before the parameters. Pass null. Also known as urlSuffix
if you have no additional path information.extraParams
- a String, that can contain extra parameters to add to
the URL after the servlet path information. Do not
prepend a '&' or '?' to the String, the method will
do that for you. You should pass a String of
the form "param=value¶m2=value2...". Pass null
if you have no additional parameters.urlPrefix
- An optional prefix that can be supplied to the servlet
path information, if non null this can overridie the
"P13N_URL_PREFIX" in the web.xml.domainName
- An optional parameter that can be used to specify a different domain
name. this is used when a proxy is located on another server. If non
null this will overrid the "P13N_URL_DOMAIN" in the web.xmlincludeParameters
- a boolean, if true then the given namespace, origin
and event will be included as parameters in
the generated URL. A value of false is suitable
for requests with hidden namespace, origin
and event parameters. Usually this should be set
to true
for GETs and
false
for POSTs.doRedirect
- a boolean, if true add param to URL to signal
webflow to redirect and not forward to the URLencode
- a boolean, if true, this method will encode the resultant URL
before returning it, using HttpServletResponse.encode().
This will add the session identifier to the URL if
it is required for this client. This should usually
true.HTTPSFlag
- an int that can be USE_HTTP, USE_HTTPS,
CALCULATE_HTTPS, or USE_WEBAPP_DEFAULT_HTTPS.
USE_WEBAPP_DEFAULT_HTTPS is new with 4.0SP2,
and is the default as of 4.0SP2. Using this value
indicates that the value for this parameter be
taken from the HTTPSIND_DEFAULT_VALUE context
parameter in web.xml (or CALCULATE_HTTPS if not
specified in web.xml).
The default for 4.0 and 4.0SP1 is CALCULATE_HTTPS.
If you do not wish for WebflowJSPHelper to calculate
whether HTTPS is required for this URL,
you may specify whether
or not HTTPS should be used. Note that HTTP is
the normal choice, but if any dependent Inputprocessor
or PipelineComponent needs HTTPS and HTTP is specified
here, a configuration error will result. If you are
unsure of which to use or wish to uphold maintainability,
specify CALCULATE_HTTPS and rely on Webflow to
calculate this for you.public static java.lang.String createStaticResourceURL(javax.servlet.jsp.PageContext pageContext, java.lang.String url, boolean encode)
Note: this method replaces createGIFUrl() from the 3.1 to 3.5 releases
pageContext
- The PageContext object from the JSP.url
- a String containing a relative URL to the static resource.
This String generally should start with a '/' character.encode
- a boolean, if true, this method will encode the resultant URL
before returning it, using HttpServletResponse.encode().
This will add the session identifier to the URL if
it is required for this client. This should usually
true.public static java.lang.String getDefaultWebflowNamespace(javax.servlet.jsp.PageContext pageContext)
pageContext
- The PageContext object from the JSP.public static java.lang.String priceFormat(double price)
Note: this method does perform rounding, so 8.999 will become 9.00. It will also add delimiting characters such as 10000 -> 10,000
price
- a double containing the price to remformatpublic static java.lang.String quantityFormat(double quantity)
quantity
- a double containing the number to format
|
© 2001 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |