public class ServletHelper extends java.lang.Object implements ECConstants
Constructor and Description |
---|
ServletHelper() |
Modifier and Type | Method and Description |
---|---|
static void | arrayCopy(java.lang.String[] fromArray, java.lang.String[] toArray)
Deprecated.
|
static java.lang.String | buildHttpsRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response)
Deprecated.
|
static java.lang.String | buildHttpsRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, java.lang.String encoding)
This method builds the URL for redirection.
|
static java.lang.String | buildRedirectUrl(java.lang.String inUrl, java.util.Map map, javax.servlet.http.HttpServletResponse response, boolean encrypt, java.lang.String encoding)
This method builds a redirect URL.
|
static java.lang.String | buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response)
Deprecated.
|
static java.lang.String | buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, boolean encrypt)
Deprecated.
|
static java.lang.String | buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, boolean encrypt, java.lang.String encoding)
This method builds the URL for redirection.
|
static java.lang.String | buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, java.lang.String encoding)
This method builds the URL for redirection.
|
static void | checkRedirectAllowed(java.lang.String url, java.lang.String servletContextName, java.lang.String requestStoreId)
Check if the URL redirection is allowed based on the servlet context name and the store ID.
|
static java.lang.String | composeEncodedQueryString(TypedProperty prop)
This method composes a query string from a TypedProperties object.
|
static java.lang.String | composeQueryString(TypedProperty prop)
This method composes a query string from a TypedProperty object.
|
static java.lang.String | decodeURL(java.lang.String val, java.lang.String encoding)
This method decodes a URL string with a given encoding.
|
static java.lang.String | encodeURL(java.lang.String val, java.lang.String encoding)
This method encodes a 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)
This method extracts the request parameters from a query string where each parameter is encoded, and converts it to a TypedProperty object.
|
static TypedProperty | extractMultipartParameters(javax.servlet.http.HttpServletRequest req)
This method extracts multipart request parameters from an HttpServletRequest object and builds a TypedProperty object based on the parameters.
|
static TypedProperty | extractRequestParameters(javax.servlet.http.HttpServletRequest req)
This method extracts the request parameters from an HttpServletRequest and builds a TypedProperty object based on the parameters.
|
static TypedProperty | extractRequestParameters(java.lang.String queryString)
This method extracts the request parameters from a query string and converts it to a TypedProperty object.
|
static com.ibm.commerce.registry.UrlRegistryEntry | findStoreUrlRegistryEntry(java.lang.String name, java.lang.Integer storeId)
Look up URL registry entry from URL registry by from all URL registry sources for store modules.
|
static java.lang.String | getActivePointerName(java.lang.String strCookiePrefix)
This method returns the name of the active pointer cookie given a specified prefix.
|
static java.lang.String | getConfigFileName(javax.servlet.http.HttpServlet servlet)
This method gets the configuration file name.
|
static java.util.Hashtable | getNVPHash(javax.servlet.http.HttpServletRequest request)
This method gets the name/value pairs.
|
static java.util.Hashtable | getNVPHashArray(javax.servlet.http.HttpServletRequest request)
This method returns a Hashtable of key/value pairs, where the values are arrays of String objects.
|
static java.lang.String | getParameter(javax.servlet.http.HttpServletRequest request, java.lang.String name)
This method returns a parameter as a String from the HttpServletRequest.
|
static java.lang.String | getRequestName(javax.servlet.http.HttpServletRequest req)
This method returns the request name that is used to select an action.
|
static java.lang.String | getSessionID(javax.servlet.http.HttpServletRequest req)
This method gets the session id.
|
static java.lang.Integer | getStoreIdFromQueryString(javax.servlet.http.HttpServletRequest req, java.lang.Integer defaultStoreId)
This method gets the store id from the query string.
|
static java.util.Vector | getURLParameters(javax.servlet.http.HttpServletRequest request)
This method gets the URL parameters.
|
static java.lang.Integer | getUserRefNum(javax.servlet.http.HttpServletRequest req)
This method gets the user reference number.
|
static boolean | isSSLRequest(javax.servlet.http.HttpServletRequest req)
This method determines whether the request comes on a secure connection.
|
static void | markTransactionToRollback()
This method marks the current transaction for roll back.
|
static TypedProperty | mergeRedirectUrlProperties(TypedProperty oldProp, TypedProperty urlProp)
This method merges the redirect URL parameter with the other properties.
|
static java.lang.String | protectQueryString(java.lang.String queryString)
This method parses a query string for protected parameters and replaces all protected parameter values with "*******"
|
static void | rollbackTransaction()
This method rolls back the current transaction.
|
static java.lang.String | servletRequestToString(javax.servlet.http.HttpServletRequest request)
This method extracts useful information from an HttpServletRequest for debugging purposes.
|
static java.lang.String | servletRequestToStringDebug(javax.servlet.http.HttpServletRequest request)
This method extracts all information from an HttpServletRequest object useful for debugging purposes.
|
static void | setEncoding(javax.servlet.http.HttpServletRequest req, java.lang.Integer sessionLangId, java.lang.Integer storeId, java.lang.String defaultEncoding)
This method sets the encoding to be used to extract the input parameters.
|
static java.lang.String | setEncoding(javax.servlet.http.HttpServletRequest req, java.lang.String strDefaultEncoding)
Deprecated.
Use setEncoding(HttpServletRequest req, String defaultEncoding, String cookiePreix) instead
|
static java.lang.String | setEncoding(javax.servlet.http.HttpServletRequest req, java.lang.String strDefaultEncoding, java.lang.String strCookiePrefix)
This method reserved for IBM Internal use only.
|
static java.lang.String[] | stringToArray(java.lang.String value)
This method converts a string with values separated by commas to an array of strings.
|
static java.lang.Integer[] | stringToIntegerArray(java.lang.String[] sarray)
This method converts an array of String objects to an array of Integer objects.
|
public static void arrayCopy(java.lang.String[] fromArray, java.lang.String[] toArray)
public static java.lang.String buildHttpsRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response) throws ECApplicationException
public static java.lang.String buildHttpsRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, java.lang.String encoding) throws ECApplicationException
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response) throws ECApplicationException
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, java.lang.String encoding) throws ECApplicationException
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, boolean encrypt) throws ECApplicationException
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, TypedProperty reqProperties, javax.servlet.http.HttpServletResponse response, boolean encrypt, java.lang.String encoding) throws ECApplicationException
public static java.lang.String composeQueryString(TypedProperty prop)
public static TypedProperty extractEncodedRequestParameters(java.lang.String queryString) throws ECApplicationException
public static TypedProperty extractEncodedRequestParameters(java.lang.String queryString, java.lang.String encoding) throws ECApplicationException
public static TypedProperty extractRequestParameters(java.lang.String queryString) throws ECApplicationException
public static TypedProperty extractRequestParameters(javax.servlet.http.HttpServletRequest req) throws ECApplicationException
public static TypedProperty extractMultipartParameters(javax.servlet.http.HttpServletRequest req) throws ECApplicationException
public static java.util.Hashtable getNVPHash(javax.servlet.http.HttpServletRequest request)
public static java.util.Hashtable getNVPHashArray(javax.servlet.http.HttpServletRequest request)
public static java.lang.String getParameter(javax.servlet.http.HttpServletRequest request, java.lang.String name)
public static java.lang.String getSessionID(javax.servlet.http.HttpServletRequest req)
public static java.util.Vector getURLParameters(javax.servlet.http.HttpServletRequest request)
public static java.lang.Integer getUserRefNum(javax.servlet.http.HttpServletRequest req)
public static void markTransactionToRollback()
public static TypedProperty mergeRedirectUrlProperties(TypedProperty oldProp, TypedProperty urlProp) throws ECApplicationException
public static java.lang.String protectQueryString(java.lang.String queryString)
public static void rollbackTransaction()
public static java.lang.String servletRequestToString(javax.servlet.http.HttpServletRequest request)
public static java.lang.String servletRequestToStringDebug(javax.servlet.http.HttpServletRequest request)
public static java.lang.String setEncoding(javax.servlet.http.HttpServletRequest req, java.lang.String strDefaultEncoding)
public static java.lang.String setEncoding(javax.servlet.http.HttpServletRequest req, java.lang.String strDefaultEncoding, java.lang.String strCookiePrefix)
public static java.lang.String[] stringToArray(java.lang.String value)
public static java.lang.Integer[] stringToIntegerArray(java.lang.String[] sarray)
public static java.lang.String composeEncodedQueryString(TypedProperty prop)
public static java.lang.String getActivePointerName(java.lang.String strCookiePrefix)
public static void setEncoding(javax.servlet.http.HttpServletRequest req, java.lang.Integer sessionLangId, java.lang.Integer storeId, java.lang.String defaultEncoding)
public static java.lang.Integer getStoreIdFromQueryString(javax.servlet.http.HttpServletRequest req, java.lang.Integer defaultStoreId)
public static java.lang.String encodeURL(java.lang.String val, java.lang.String encoding) throws java.io.UnsupportedEncodingException
public static java.lang.String decodeURL(java.lang.String val, java.lang.String encoding) throws java.io.UnsupportedEncodingException
public static java.lang.String buildRedirectUrl(java.lang.String inUrl, java.util.Map map, javax.servlet.http.HttpServletResponse response, boolean encrypt, java.lang.String encoding) throws java.lang.Exception
public static java.lang.String getConfigFileName(javax.servlet.http.HttpServlet servlet) throws javax.servlet.ServletException
public static boolean isSSLRequest(javax.servlet.http.HttpServletRequest req)
public static java.lang.String getRequestName(javax.servlet.http.HttpServletRequest req)
public static com.ibm.commerce.registry.UrlRegistryEntry findStoreUrlRegistryEntry(java.lang.String name, java.lang.Integer storeId)
public static void checkRedirectAllowed(java.lang.String url, java.lang.String servletContextName, java.lang.String requestStoreId) throws ECApplicationException