|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.remote.util.RequestParameterParser
Handles request body using the character set passed by Plumtree. Form bodies have one of 3 content types, "multipart/form-data" | "text/plain" | "application/x-www-form-urlencoded". This information is set in the html form tag, FORM ENCTYPE="multipart/form-data", (browsers default to "application/x-www-form-urlencoded" if one is not specified).
"application/x-www-form-urlencoded"
-- For Servlet 2.3 systems the class will use 2.3 methods to convert the body to Unicode.
-- For Servlet 2.2 systems it is more complicated. Servlet 2.2 engines by default will convert the body to Unicode with a default character set (most are hard coded to 8859-1). This creates a problem because in some character sets, it is not possible to get the original bytes back once converted to Unicode. RequestParameterParser will attempt to get the original bytes back by assuming a character set of 8859-1, and convert to the bytes to the character set that was passed from the Portal Server. Weblogic 6.0sp2 has a problem with certain characters being lost.
"multipart/form-data"
Application Servers will not parse bodies with this content type. RequestParameterParser will not read this data.
"text/plain"
Application Servers will not parse bodies with this content type. RequestParameterParser will not read this data.
NOTE: Version 4.5 and above pass the character set in a portal header.
Constructor Summary | |
RequestParameterParser(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles request parameters using the character set passed by the portal. |
|
RequestParameterParser(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String overridingCharacterSet)
Handles request parameters using the character set passed as parameter |
Method Summary | |
static java.lang.String |
convertStringToHex(java.lang.String strIn)
Helper method for getting a hex string. |
boolean |
getBooleanParameter(java.lang.String name)
Returns the value of a request parameter. |
boolean |
getBooleanParameter(java.lang.String name,
boolean defaultValue)
Returns the value of a request parameter or the default value if not specified. |
byte |
getByteParameter(java.lang.String name)
Returns the value of a request parameter. |
byte |
getByteParameter(java.lang.String name,
byte defaultValue)
Returns the value of a request parameter or the default value if not specified. |
char |
getCharParameter(java.lang.String name)
Returns the value of a request parameter. |
char |
getCharParameter(java.lang.String name,
char defaultValue)
Returns the value of a request parameter or the default value if not specified. |
double |
getDoubleParameter(java.lang.String name)
Returns the value of a request parameter. |
double |
getDoubleParameter(java.lang.String name,
double defaultValue)
Returns the value of a request parameter or the default value if not specified. |
float |
getFloatParameter(java.lang.String name)
Returns the value of a request parameter. |
float |
getFloatParameter(java.lang.String name,
float defaultValue)
Returns the value of a request parameter or the default value if not specified. |
int |
getIntParameter(java.lang.String name)
Returns the value of a request parameter. |
int |
getIntParameter(java.lang.String name,
int defaultValue)
Returns the value of a request parameter or the default value if not specified. |
long |
getLongParameter(java.lang.String name)
Returns the value of a request parameter. |
long |
getLongParameter(java.lang.String name,
long defaultValue)
Returns the value of a request parameter or the default value if not specified. |
java.lang.String |
getParameter(java.lang.String name)
Returns the value of a request parameter as a string, null if the parameter does not exist. |
java.lang.String |
getParameter(java.lang.String name,
java.lang.String defaultValue)
Returns the value of a request parameter or the default value if not specified. |
java.util.Enumeration |
getParameterNames()
Returns an enumeration of the parameter names. |
java.lang.String[] |
getParameterValues(java.lang.String name)
Returns an array of String objects containing all of the values the given request parameter has, null if the parameter does not exist. |
short |
getShortParameter(java.lang.String name)
Returns the value of a request parameter. |
short |
getShortParameter(java.lang.String name,
short defaultValue)
Returns the value of a request parameter or the default value if not specified. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RequestParameterParser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.UnsupportedEncodingException
request
- The HTTP request objectresponse
- The HTTP response object
java.io.UnsupportedEncodingException
- if the request is encoded in an unsupported encoding schemepublic RequestParameterParser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String overridingCharacterSet) throws java.io.UnsupportedEncodingException
request
- The HTTP request objectresponse
- The HTTP response objectoverridingCharacterSet
- Character set user explicitly wants to use
java.io.UnsupportedEncodingException
- if the request is encoded in an unsupported encoding schemeMethod Detail |
public java.util.Enumeration getParameterNames()
public java.lang.String[] getParameterValues(java.lang.String name)
name
- A string containing the name of the parameter whose value is requested.
public java.lang.String getParameter(java.lang.String name)
name
- The name of the parameter to look up.
public java.lang.String getParameter(java.lang.String name, java.lang.String defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public boolean getBooleanParameter(java.lang.String name) throws java.lang.NumberFormatException, java.lang.NullPointerException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as a java.lang.NullPointerException
- if the parameter does not existpublic boolean getBooleanParameter(java.lang.String name, boolean defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public byte getByteParameter(java.lang.String name) throws java.lang.NullPointerException, java.lang.NumberFormatException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as a java.lang.NullPointerException
- if the parameter does not existpublic byte getByteParameter(java.lang.String name, byte defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public char getCharParameter(java.lang.String name) throws java.lang.NullPointerException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as a java.lang.NullPointerException
- if the parameter does not existpublic char getCharParameter(java.lang.String name, char defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public double getDoubleParameter(java.lang.String name) throws java.lang.NullPointerException, java.lang.NumberFormatException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as a java.lang.NullPointerException
- if the parameter does not existpublic double getDoubleParameter(java.lang.String name, double defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public float getFloatParameter(java.lang.String name) throws java.lang.NullPointerException, java.lang.NumberFormatException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as a java.lang.NullPointerException
- if the parameter does not existpublic float getFloatParameter(java.lang.String name, float defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public int getIntParameter(java.lang.String name) throws java.lang.NullPointerException, java.lang.NumberFormatException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as an java.lang.NullPointerException
- if the parameter does not existpublic int getIntParameter(java.lang.String name, int defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public long getLongParameter(java.lang.String name) throws java.lang.NullPointerException, java.lang.NumberFormatException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as a java.lang.NullPointerException
- if the parameter does not existpublic long getLongParameter(java.lang.String name, long defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public short getShortParameter(java.lang.String name) throws java.lang.NullPointerException, java.lang.NumberFormatException
name
- The parameter name.
java.lang.NumberFormatException
- if the parameter cannot be interpreted as a java.lang.NullPointerException
- if the parameter does not existpublic short getShortParameter(java.lang.String name, short defaultValue)
name
- The parameter name.defaultValue
- The default parameter value.
public static java.lang.String convertStringToHex(java.lang.String strIn)
strIn
- The string to print out the hex values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©2010 Oracle® Corporation. All Rights Reserved.