|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.axiom.jsp.JspHelper
A helper class for all JSP pages.
Some of these methods assume the you are using the FlowManager model which
is highly recommended but not required.
Prescribes methods which faciltate p13n run-time operation. Allows access
to the FlowManager
URI, the application's working
directory, the home page, and the current page.
Also, facilitates management of the application's run-time session, by providing
convenience methods for setting and getting session values, and
setting and getting JSP destinations. Implements several constants
interface to reduce the burden of constant referencing by JSP pages.
Constructor Summary | |
JspHelper()
|
Method Summary | |
static java.lang.String |
decode(java.lang.String aString)
Decodes the provided String using a Base64Decoder . |
static java.lang.String |
encode(java.lang.String aString)
Encodes the provided String using a Base64Encoder . |
static javax.servlet.http.Cookie |
findCookie(java.lang.String aName,
javax.servlet.http.Cookie[] cookies)
Finds the cookie for a given cookie name. |
static int |
getCookieTimeout(javax.servlet.http.HttpServletRequest aRequest)
Retrieves the p13n app Cookie timeout, in seconds. |
static java.lang.String |
getCookieValue(java.lang.String aName,
javax.servlet.http.Cookie[] cookies)
Retrieves a particular cookie value from a set of javax.servlet.http.Cookie objects. |
static java.lang.String |
getDefaultDestination(javax.servlet.http.HttpServletRequest aRequest)
Retrieves the default destination of the p13n app associated with the provided javax.servlet.http.HttpServletRequest . |
static java.lang.String |
getDefaultSuccessor(javax.servlet.http.HttpServletRequest aRequest)
Get the default succssor (group) that was specified in the servlet registration. |
static java.util.Hashtable |
getDequalifiedSessionValues(javax.servlet.http.HttpServletRequest request)
Deprecated. As of WLPS 3.1, replaced by getSessionValues(HttpServletRequest request) |
static boolean |
getLoggedIn(javax.servlet.http.HttpServletRequest aRequest)
Determines whether a user is currently logged into the p13n app. |
static java.lang.String |
getRepositoryDirectory(javax.servlet.http.HttpServletRequest aRequest)
Retrieves the repository directory of the p13n application associated with the provided javax.servlet.http.HttpServletRequest . |
static javax.servlet.ServletConfig |
getServletConfig(javax.servlet.http.HttpServletRequest aRequest)
Retrieves the current ServletConfig object, as set by the default destination determiner. |
static java.lang.Object |
getSessionValue(java.lang.String aName,
javax.servlet.http.HttpServletRequest aRequest)
Retrieves a session value based on the name provided. |
static java.lang.Object |
getSessionValue(java.lang.String scopeName,
java.lang.String aName,
javax.servlet.http.HttpServletRequest aRequest)
Retrieves a session value based on the name provided. |
static java.util.Map |
getSessionValues(javax.servlet.http.HttpServletRequest request)
Retrieves a map of session property names and their corresponding values for the provided request. |
static java.util.Map |
getSessionValues(javax.servlet.http.HttpServletRequest request,
com.beasys.commerce.axiom.util.filter.MapFilter filter)
Retrieves a map of session property names and their corresponding values for the provided request. |
static java.lang.String |
getTrafficURI(javax.servlet.http.HttpServletRequest aRequest)
Retrieves the URI of the FlowManager associated
with the request. |
static java.lang.String |
getTrafficURINoContext(javax.servlet.http.HttpServletRequest aRequest)
Get traffic URI with no context. |
static java.lang.String |
getWorkingDirectory(javax.servlet.http.HttpServletRequest aRequest)
Retrieves the working directory of the p13n app associated with the provided javax.servlet.http.HttpServletRequest . |
static boolean |
isWar(javax.servlet.ServletContext ctx)
Determines if the context is deployed as a WAR file |
static void |
putSessionValue(java.lang.String aName,
java.lang.Object aValue,
javax.servlet.http.HttpServletRequest aRequest)
Sets a session value based on the name provided. |
static void |
putSessionValue(java.lang.String scopeName,
java.lang.String aName,
java.lang.Object aValue,
javax.servlet.http.HttpServletRequest aRequest)
Sets a session value based on the scope name and propertyname provided. |
static java.lang.String |
qualifiedName(java.lang.String aBaseName,
javax.servlet.http.HttpServletRequest aRequest)
Creates a name, based on the provided base name, which uniquely identifies a session paramater as belonging to a particular FlowManager . |
static void |
removeSessionValue(java.lang.String aName,
javax.servlet.http.HttpServletRequest aRequest)
Removes a session value based on the name provided. |
static void |
setCookie(java.lang.String aName,
java.lang.String aValue,
javax.servlet.http.Cookie[] cookies,
javax.servlet.http.HttpServletResponse aResponse,
int aMaxAge)
Locates a javax.servlet.http.Cookie with a name matching the provided name,
and sets the value of the Cookie to the provided value. |
static void |
setSessionValue(java.lang.String aName,
java.lang.Object aValue,
javax.servlet.http.HttpServletRequest aRequest)
Sets a session value based on the name provided. |
static void |
setSessionValue(java.lang.String scopeName,
java.lang.String aName,
java.lang.Object aValue,
javax.servlet.http.HttpServletRequest aRequest)
Sets a session value based on the scope name and propertyname provided. |
static boolean |
validSession(javax.servlet.http.HttpServletRequest aRequest)
Checks to see if the session has all of the valid values for p13n run-time. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public JspHelper()
Method Detail |
public static boolean validSession(javax.servlet.http.HttpServletRequest aRequest)
the
- javax.servlet.http.HttpServletRequest
from which
the session is retreivedboolean
whether the session is validpublic static javax.servlet.http.Cookie findCookie(java.lang.String aName, javax.servlet.http.Cookie[] cookies)
aName
- the cookie namecookies
- an array of cookies previously obtain from from the request.Cookie
the cookie if found, null
if not.public static java.lang.String getDefaultSuccessor(javax.servlet.http.HttpServletRequest aRequest)
aRequest.
- public static java.lang.String encode(java.lang.String aString)
String
using a Base64Encoder
.aString
- the String
to encodeString
the encoded version of the provided String
public static java.lang.String decode(java.lang.String aString) throws java.io.IOException
String
using a Base64Decoder
.the
- String
to decodeString
the decoded version of the provided String
IOException
- buffer read errorpublic static void setCookie(java.lang.String aName, java.lang.String aValue, javax.servlet.http.Cookie[] cookies, javax.servlet.http.HttpServletResponse aResponse, int aMaxAge)
a javax.servlet.http.Cookie
with a name matching the provided name,
and sets the value of the Cookie
to the provided value.
Also, sets the maximum age of the Cookie
to the age provided.
If a cookie is not found in the provided array, a new cookie
is created, and appropriate values are set.aName
- the Cookie
nameaValue
- the new Cookie
valuecookies
- the array of Cookie
object searched for the provided nameaResponse
- the javax.servlet.http.HttpServletResponse
to which the cookie is addedaMaxAge
- the maximum cookie age, in secondspublic static java.lang.String getTrafficURI(javax.servlet.http.HttpServletRequest aRequest)
FlowManager
associated
with the request.aRequest
- the request used to obtain the Traffic URI.String
Returns the JspService Manager, null
none exists for this request.public static java.lang.String getTrafficURINoContext(javax.servlet.http.HttpServletRequest aRequest)
aRequest
- String
public static java.lang.String getWorkingDirectory(javax.servlet.http.HttpServletRequest aRequest)
javax.servlet.http.HttpServletRequest
.aRequest
- the HttpServletRequest
associated
with the p13n appString
the working directory of the p13n app,
returns null if none exists.public static java.lang.String getRepositoryDirectory(javax.servlet.http.HttpServletRequest aRequest)
javax.servlet.http.HttpServletRequest
.aRequest
- the HttpServletRequest
associated
with the portalString
the working directory of the p13n app,
returns null if none exists.public static java.lang.String getDefaultDestination(javax.servlet.http.HttpServletRequest aRequest)
javax.servlet.http.HttpServletRequest
.
This value is the destination to which the FlowManager
directs the browser when no alternate destination is provided to
the FlowManager
.aRequest
- the HttpServletRequest
associated
with the p13n appString
the default destination of the p13n apppublic static javax.servlet.ServletConfig getServletConfig(javax.servlet.http.HttpServletRequest aRequest)
the
- javax.servlet.http.HttpServletRequest
corresponding
to the FlowManager
ServletConfig
the current request's configurationpublic static boolean isWar(javax.servlet.ServletContext ctx)
ctx
- The ServletContext associated with this handler.public static java.lang.String qualifiedName(java.lang.String aBaseName, javax.servlet.http.HttpServletRequest aRequest)
FlowManager
. This prevents naming collisions
between multiple p13n app instances, as multiple p13n apps can be
part of the same session. If a FlowManager is not present
then the 'aBaseName' parameter is used without any namespacing.aBaseName
- the base parameter name (e.g. "userName")aRequest
- the HttpServletRequest
used to retrieve the
Traffic URI, and therefore the correct FlowManager
name.String
public static java.lang.String getCookieValue(java.lang.String aName, javax.servlet.http.Cookie[] cookies) throws java.io.IOException
javax.servlet.http.Cookie
objects.aName
- the name of the Cookie
from which the
value is soughtcookies
- an array of Cookie
objects which is
searched for the cookie whose name matches the provided nameString
the value of the cookie, if found ;
null
otherwiseIOException
- propagated from decode
.public static int getCookieTimeout(javax.servlet.http.HttpServletRequest aRequest)
Cookie
timeout, in seconds.aRequest
- the javax.servlet.http.HttpServletRequest
associated with the p13n appint
the Cookie
timeout, in seconds.public static boolean getLoggedIn(javax.servlet.http.HttpServletRequest aRequest)
aRequest
- the javax.servle.http.HttpServletRequest
used to
retrieve the p13n app's sessionboolean
whether a user is currently logged into
the p13n apppublic static java.lang.Object getSessionValue(java.lang.String aName, javax.servlet.http.HttpServletRequest aRequest)
aName
- the name of the session value to be retrievedaRequest
- the javax.servlet.http.HttpServletRequest
used to
retrieve the current sessionObject
public static java.lang.Object getSessionValue(java.lang.String scopeName, java.lang.String aName, javax.servlet.http.HttpServletRequest aRequest)
scopeName
- the scope associated with the propertyaName
- the name of the session value to be retrievedaRequest
- the javax.servlet.http.HttpServletRequest
used to
retrieve the current sessionObject
public static void setSessionValue(java.lang.String aName, java.lang.Object aValue, javax.servlet.http.HttpServletRequest aRequest)
aName
- the name of the session value to be setaValue
- the new session valueaRequest
- the javax.servlet.http.HttpServletRequest
used to
retrieve the current sessionObject
public static void putSessionValue(java.lang.String aName, java.lang.Object aValue, javax.servlet.http.HttpServletRequest aRequest)
aName
- the name of the session value to be setaValue
- the new session valueaRequest
- the javax.servlet.http.HttpServletRequest
used to
retrieve the current sessionObject
public static void putSessionValue(java.lang.String scopeName, java.lang.String aName, java.lang.Object aValue, javax.servlet.http.HttpServletRequest aRequest)
scopeName
- the name of the scope associated with the session valueaName
- the name of the session value to be setaValue
- the new session valueaRequest
- the javax.servlet.http.HttpServletRequest
used to
retrieve the current sessionObject
public static void setSessionValue(java.lang.String scopeName, java.lang.String aName, java.lang.Object aValue, javax.servlet.http.HttpServletRequest aRequest)
scopeName
- the name of the scope associated with the session valueaName
- the name of the session value to be setaValue
- the new session valueaRequest
- the javax.servlet.http.HttpServletRequest
used to
retrieve the current sessionObject
public static void removeSessionValue(java.lang.String aName, javax.servlet.http.HttpServletRequest aRequest)
aName
- the name of the session value to be removedaRequest
- the javax.servlet.http.HttpServletRequest
used to
retrieve the current sessionObject
public static java.util.Hashtable getDequalifiedSessionValues(javax.servlet.http.HttpServletRequest request)
getSessionValues(HttpServletRequest request)
request
- the request whose session's values are soughtnull
if no traffic URI is obtainedpublic static java.util.Map getSessionValues(javax.servlet.http.HttpServletRequest request)
request
- the request whose session's values are soughtnull
if no traffic URI is obtainedpublic static java.util.Map getSessionValues(javax.servlet.http.HttpServletRequest request, com.beasys.commerce.axiom.util.filter.MapFilter filter)
request
- the request whose session's values are soughtnull
if no traffic URI is obtained
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |