java.lang.Object | +--com.ibm.commerce.server.ServletHelper
The ServletHelper class contains static methods used by the request servlet
Constructor Summary | |
---|---|
ServletHelper() |
Method Summary | |
---|---|
static void |
arrayCopy(java.lang.String[] fromArray,
java.lang.String[] toArray) Copies the content of one array to another string array |
static java.lang.String |
buildHttpsRedirectUrl(java.lang.String inUrl,
TypedProperty reqProperties, HttpServletResponse response) Deprecated. Replaced by buildHttpsRedirectUrl(String,TypedProperty,HttpServletResponse,String) |
static java.lang.String |
buildHttpsRedirectUrl(java.lang.String inUrl,
TypedProperty reqProperties, HttpServletResponse response,
java.lang.String encoding) Builds the url for redirection. |
static java.lang.String |
buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties,
HttpServletResponse response) Deprecated. Replaced by buildRedirectUrl(String,TypedProperty,HttpServletResponse,String) |
static java.lang.String |
buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties,
HttpServletResponse response, boolean encrypt) Deprecated. Replaced by buildRedirectUrl(String,TypedProperty,HttpServletResponse,boolean,String) |
static java.lang.String |
buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties,
HttpServletResponse response, boolean encrypt,
java.lang.String encoding) Builds the url for redirection. |
static java.lang.String |
buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties,
HttpServletResponse response, java.lang.String encoding) Builds the url for redirection. |
static java.lang.String |
composeEncodedQueryString(TypedProperty prop) Composes a query string from the typedProperties. |
static java.lang.String |
composeQueryString(TypedProperty prop) Composse a query string from the typedProperties. |
static java.lang.String |
decodeURL(java.lang.String val, java.lang.String encoding) Decode an url string with a given encoding. |
static java.lang.String |
encodeURL(java.lang.String val, java.lang.String encoding) Encode an url string with a given encoding. |
static TypedProperty |
extractEncodedRequestParameters(java.lang.String queryString) Deprecated. Replaced by extractEncodedRequestParameters(String,String) |
static TypedProperty |
extractEncodedRequestParameters(java.lang.String queryString,
java.lang.String encoding) Extracts the request parameters from a query string where each parameter is encoded, and convert it to a TypedProperty object. |
static TypedProperty |
extractMultipartParameters(HttpServletRequest req) Extracts multipart request parameters from a HttpServletRequest and build an TypedProperty object based on the parameters. |
static TypedProperty |
extractRequestParameters(java.lang.String queryString) Extracts the request parameters from a query string and convert it to a TypedProperty object. |
static java.util.Hashtable |
getNVPHash(HttpServletRequest request) Gets the name value pairs. |
static java.util.Hashtable |
getNVPHashArray(HttpServletRequest request) Returns Hashtable of key-value pairs, where the values are arrays of Strings. |
static java.lang.String |
getParameter(HttpServletRequest request,
java.lang.String name) Returns a parameter as string from the HttpServletRequest. |
static java.lang.String |
getSessionID(HttpServletRequest req) Gets the sessoin Id. |
static java.lang.Integer |
getStoreIdFromQueryString(HttpServletRequest req,
java.lang.Integer defaultStoreId) Gets the store id fromthe query string. |
static java.util.Vector |
getURLParameters(HttpServletRequest request) Gets the sessoin Id. |
static java.lang.Integer |
getUserRefNum(HttpServletRequest req) Gets the user reference number. |
static void |
markTransactionToRollback() Marks the current transaction for roll back. |
static TypedProperty |
mergeRedirectUrlProperties(TypedProperty oldProp,
TypedProperty urlProp) Merges the redirect URL parameter with other properties . |
static java.lang.String |
protectQueryString(java.lang.String queryString) Parses a query string for protected parameters and replaces all protected paramaeter values with "*******" |
static void |
rollbackTransaction() Rolls back the current transaction. |
static java.lang.String |
servletRequestToString(javax.servlet.http.HttpServletRequest request) Extracts many useful information for debugging purposes from a HttpServletRequest. |
static java.lang.String |
servletRequestToStringDebug(javax.servlet.http.HttpServletRequest request) Extracts all information useful for debugging purposes from a HttpServletRequest. |
static void |
setEncoding(HttpServletRequest req, java.lang.Integer sessionLangId,
java.lang.Integer storeId, java.lang.String defaultEncoding) Sets the encoding to be used to extract the input parameters. |
static java.lang.String |
setEncoding(HttpServletRequest req,
java.lang.String defaultEncoding) Set the encoding for used for retreiving request parameters. |
static java.lang.String[] |
stringToArray(java.lang.String value) Converts a string with values seperated by commas to an array of strings. |
static java.lang.Integer[] |
stringToIntegerArray(java.lang.String[] sarray) Converts an array of Strings to an array of Integers. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Constructor Detail |
public ServletHelper()
Method Detail |
public static void arrayCopy(java.lang.String[] fromArray, java.lang.String[] toArray)
fromArray
- original arraytoArray
- new arraypublic static java.lang.String buildHttpsRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, HttpServletResponse response) throws ECApplicationException
buildHttpsRedirectUrl(String,TypedProperty,HttpServletResponse,String)
inUrl
- urlreqProperties
- request propertiesECApplicationException
-
public static java.lang.String buildHttpsRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, HttpServletResponse response, java.lang.String encoding) throws ECApplicationException
inUrl
- urlreqProperties
- request propertiesencoding
- character encoding
ECApplicationException
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, HttpServletResponse response) throws ECApplicationException
buildRedirectUrl(String,TypedProperty,HttpServletResponse,String)
inUrl
- urlreqProperties
- request propertyresponse
- http servlet response
ECApplicationException
-
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, HttpServletResponse response, java.lang.String encoding) throws ECApplicationException
inUrl
- urlreqProperties
- request propertyresponse
- http servlet responseencoding
- character encoding
ECApplicationException
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, HttpServletResponse response, boolean encrypt) throws ECApplicationException
buildRedirectUrl(String,TypedProperty,HttpServletResponse,boolean,String)
inUrl
- urlreqProperties
- request propertyresponse
- http servlet responseencrypt
- true if the url parameters will be encrypted
ECApplicationException
-
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, HttpServletResponse response, boolean encrypt, java.lang.String encoding) throws ECApplicationException
inUrl
- urlreqProperties
- request propertyresponse
- http servlet responseencrypt
- true if the url parameters will be encryptedencoding
- character encoding
ECApplicationException
public static java.lang.String composeQueryString(TypedProperty prop)
prop
- type properties
public static TypedProperty extractEncodedRequestParameters(java.lang.String queryString) throws ECApplicationException
extractEncodedRequestParameters(String,String)
queryString
- query string
ECApplicationException
-
public static TypedProperty extractEncodedRequestParameters(java.lang.String queryString, java.lang.String encoding) throws ECApplicationException
queryString
- query stringencoding
- character encoding
ECApplicationException
public static TypedProperty extractRequestParameters(java.lang.String queryString) throws ECApplicationException
queryString
- query stringECApplicationException
public static TypedProperty extractMultipartParameters(HttpServletRequest req) throws ECApplicationException
req
- http servlet requestECApplicationException
public static java.util.Hashtable getNVPHash(HttpServletRequest request)
request
- http servlet requestpublic static java.util.Hashtable getNVPHashArray(HttpServletRequest request)
request
- http servlet requestpublic static java.lang.String getParameter(HttpServletRequest request, java.lang.String name)
request
- http servlet requestname
- the name of the parameter you're looking forpublic static java.lang.String getSessionID(HttpServletRequest req)
req
- http servlet requestpublic static java.util.Vector getURLParameters(HttpServletRequest request)
public static java.lang.Integer getUserRefNum(HttpServletRequest req)
req
- http servlet requestpublic static void markTransactionToRollback()
public static TypedProperty mergeRedirectUrlProperties(TypedProperty oldProp, TypedProperty urlProp) throws ECApplicationException
ECApplicationException
public static java.lang.String protectQueryString(java.lang.String queryString)
queryString
- query stringpublic static void rollbackTransaction()
public static java.lang.String servletRequestToString(javax.servlet.http.HttpServletRequest request)
request
- http servlet requestpublic static java.lang.String servletRequestToStringDebug(javax.servlet.http.HttpServletRequest request)
request
- http servlet requestpublic static java.lang.String setEncoding(HttpServletRequest req, java.lang.String defaultEncoding)
req
- http servlet requestdefaultEncoding
- encoding valuepublic static java.lang.String[] stringToArray(java.lang.String value)
value
- string to be converted to an arraypublic static java.lang.Integer[] stringToIntegerArray(java.lang.String[] sarray)
sarray
- array of stringpublic static java.lang.String composeEncodedQueryString(TypedProperty prop)
prop
- type properties
public static void setEncoding(HttpServletRequest req, java.lang.Integer sessionLangId, java.lang.Integer storeId, java.lang.String defaultEncoding)
req
- the HttpServletRequest objectsessionLangId
- language id saved in sessionstoreId
- store IddefaultEncoding
- default encodingpublic static java.lang.Integer getStoreIdFromQueryString(HttpServletRequest req, java.lang.Integer defaultStoreId)
req
- the HttpServletRequest objectdefaultStoreId
- default store Idpublic static java.lang.String encodeURL(java.lang.String val, java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String decodeURL(java.lang.String val, java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException