|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.war.tools.AttributeTools
public class AttributeTools
Nested Class Summary | |
---|---|
static class |
AttributeTools.MimePart
|
Field Summary | |
---|---|
static java.lang.String |
ATTR_MULTIPART
|
static java.lang.String |
ATTR_RTP
|
static int |
MAX_BINARY_SIZE
|
static java.lang.String |
MIMEPART_BYTES
|
static java.lang.String |
MIMEPART_FILE
|
static java.lang.String |
MIMEPART_FILENAME
|
static java.lang.String |
MIMEPART_INCOMPLETE
|
static java.lang.String |
MIMEPART_NAME
|
static java.lang.String |
MIMEPART_STRING
|
Constructor Summary | |
---|---|
AttributeTools()
|
Method Summary | |
---|---|
protected static void |
_parseMultipartFormData(javax.servlet.http.HttpServletRequest request,
int maxLen,
java.io.File fileSaveDir)
Parse "multipart/form-data" paramters. |
static void |
clearSessionAttributes(javax.servlet.http.HttpSession sess)
Clears all HttpSession attributes |
static void |
clearSessionAttributes(javax.servlet.ServletRequest req)
Clears all ServletRequest attributes |
static int |
getContentLength(javax.servlet.http.HttpServletRequest req)
Gets the content length for the specified Request |
static java.lang.String |
getContentType(javax.servlet.http.HttpServletRequest req)
Gets the content type for the specified Request |
static java.lang.String[] |
getMatchingKeys(javax.servlet.ServletRequest req,
java.lang.String key_)
Returns an array of keys from the list of session request parameters that match the specified partial key. |
static RTProperties |
getMultipartProperties(javax.servlet.http.HttpServletRequest request)
Get MultiPart Mime parameters |
static java.lang.Object |
getRequestAttribute(javax.servlet.ServletRequest req,
java.lang.String[] key,
java.lang.Object dft)
Returns the value for the specified key from the ServletRequest. |
static java.lang.Object |
getRequestAttribute(javax.servlet.ServletRequest req,
java.lang.String key,
java.lang.Object dft)
Returns the value for the specified key from the ServletRequest. |
static boolean |
getRequestBoolean(javax.servlet.ServletRequest req,
java.lang.String[] key,
boolean dft)
Returns the Boolean value of the specified key from the parameter list in the specified ServletRequest |
static boolean |
getRequestBoolean(javax.servlet.ServletRequest req,
java.lang.String key,
boolean dft)
Returns the Boolean value of the specified key from the parameter list in the specified ServletRequest |
static boolean |
getRequestCheckbox(javax.servlet.ServletRequest req,
java.lang.String key)
Returns the Boolean value of the specified key from the parameter list in the specified ServletRequest. |
static boolean |
getRequestCheckbox(javax.servlet.ServletRequest req,
java.lang.String[] key)
Returns the Boolean value of the specified key from the parameter list in the specified ServletRequest. |
static double |
getRequestDouble(javax.servlet.ServletRequest req,
java.lang.String[] key,
double dft)
Returns the Double value of the specified key from the parameter list in the specified ServletRequest |
static double |
getRequestDouble(javax.servlet.ServletRequest req,
java.lang.String key,
double dft)
Returns the Double value of the specified key from the parameter list in the specified ServletRequest |
static int |
getRequestInt(javax.servlet.ServletRequest req,
java.lang.String[] key,
int dft)
Returns the Int value of the specified key from the parameter list in the specified ServletRequest |
static int |
getRequestInt(javax.servlet.ServletRequest req,
java.lang.String key,
int dft)
Returns the Int value of the specified key from the parameter list in the specified ServletRequest |
static long |
getRequestLong(javax.servlet.ServletRequest req,
java.lang.String[] key,
long dft)
Returns the Long value of the specified key from the parameter list in the specified ServletRequest |
static long |
getRequestLong(javax.servlet.ServletRequest req,
java.lang.String key,
long dft)
Returns the Long value of the specified key from the parameter list in the specified ServletRequest |
static java.lang.String |
getRequestString(javax.servlet.ServletRequest req,
java.lang.String[] keyList,
java.lang.String dft)
Returns the String value of the specified key from the parameter list in the specified ServletRequest |
static java.lang.String |
getRequestString(javax.servlet.ServletRequest req,
java.lang.String key,
java.lang.String dft)
Returns the String value of the specified key from the parameter list in the specified ServletRequest |
static javax.servlet.ServletContext |
getServletContext(javax.servlet.ServletRequest req)
Returns the ServletContext from the specified ServletRequest |
static javax.servlet.http.HttpSession |
getSession(javax.servlet.ServletRequest req)
Returns the HttpSession from the specified ServletRequest |
static java.lang.Object |
getSessionAttribute(javax.servlet.http.HttpSession sess,
java.lang.String[] key,
java.lang.Object dft)
Gets the value for the specified attribute key from the specified HttpSession |
static java.lang.Object |
getSessionAttribute(javax.servlet.http.HttpSession sess,
java.lang.String key,
java.lang.Object dft)
Gets the value for the specified attribute key from the specified HttpSession |
static java.lang.Object |
getSessionAttribute(javax.servlet.ServletRequest req,
java.lang.String[] key,
java.lang.Object dft)
Gets the value for the specified attribute key from the specified ServletRequest |
static java.lang.Object |
getSessionAttribute(javax.servlet.ServletRequest req,
java.lang.String key,
java.lang.Object dft)
Gets the value for the specified attribute key from the specified ServletRequest |
static boolean |
getSessionBoolean(javax.servlet.ServletRequest req,
java.lang.String[] key,
boolean dft)
Gets the Boolean value for the specified attribute key from the specified ServletRequest |
static boolean |
getSessionBoolean(javax.servlet.ServletRequest req,
java.lang.String key,
boolean dft)
Gets the Boolean value for the specified attribute key from the specified ServletRequest |
static double |
getSessionDouble(javax.servlet.ServletRequest req,
java.lang.String[] key,
double dft)
Gets the Double value for the specified attribute key from the specified ServletRequest |
static double |
getSessionDouble(javax.servlet.ServletRequest req,
java.lang.String key,
double dft)
Gets the Double value for the specified attribute key from the specified ServletRequest |
static int |
getSessionInt(javax.servlet.ServletRequest req,
java.lang.String[] key,
int dft)
Gets the Int value for the specified attribute key from the specified ServletRequest |
static int |
getSessionInt(javax.servlet.ServletRequest req,
java.lang.String key,
int dft)
Gets the Int value for the specified attribute key from the specified ServletRequest |
static long |
getSessionLong(javax.servlet.ServletRequest req,
java.lang.String[] key,
long dft)
Gets the Long value for the specified attribute key from the specified ServletRequest |
static long |
getSessionLong(javax.servlet.ServletRequest req,
java.lang.String key,
long dft)
Gets the Long value for the specified attribute key from the specified ServletRequest |
static int |
GetSessionSequence(javax.servlet.http.HttpServletRequest request)
Returns the current session sequence ID |
static java.lang.String |
getSessionString(javax.servlet.ServletRequest req,
java.lang.String[] key,
java.lang.String dft)
Gets the String value for the specified attribute key from the specified ServletRequest |
static java.lang.String |
getSessionString(javax.servlet.ServletRequest req,
java.lang.String key,
java.lang.String dft)
Gets the String value for the specified attribute key from the specified ServletRequest |
static boolean |
hasMultipartFormData(javax.servlet.http.HttpServletRequest request)
Return true if multi-part form data is present |
static boolean |
hasRequestAttribute(javax.servlet.ServletRequest req,
java.lang.String key)
Returns true if the specified key is defined in the parameter list for the specified ServletRequest. |
static boolean |
hasRequestAttribute(javax.servlet.ServletRequest req,
java.lang.String[] key)
Returns true if the specified key is defined in the parameter list for the specified ServletRequest. |
static boolean |
hasSessionAttribute(javax.servlet.http.HttpSession sess,
java.lang.String key)
Returns true if the specified attribute key is defined in the specified HttpSession |
static boolean |
hasSessionAttribute(javax.servlet.http.HttpSession sess,
java.lang.String[] key)
Returns true if the specified attribute key is defined in the specified HttpSession |
static boolean |
hasSessionAttribute(javax.servlet.ServletRequest req,
java.lang.String key)
Returns true if the specified attribute key is defined in the specified ServletRequest |
static boolean |
hasSessionAttribute(javax.servlet.ServletRequest req,
java.lang.String[] key)
Returns true if the specified attribute key is defined in the specified ServletRequest |
static void |
main(java.lang.String[] argv)
|
static boolean |
parseMultipartFormData(javax.servlet.http.HttpServletRequest request)
Parse "multipart/form-data" paramters |
static boolean |
parseMultipartFormData(javax.servlet.http.HttpServletRequest request,
int maxLen,
java.io.File fileSaveDir)
Parse "multipart/form-data" paramters |
static RTProperties |
parseRTP(javax.servlet.ServletRequest req)
Looks for and decodes request argument "rtp" and adds any contained properties to the request attributes. |
static void |
printHeaders(javax.servlet.http.HttpServletRequest req,
java.lang.String title)
Print headers |
static void |
printParameters(javax.servlet.http.HttpServletRequest req,
java.lang.String title)
Print Paramewters |
static void |
setSessionAttribute(javax.servlet.http.HttpSession sess,
java.lang.String key,
java.lang.Object val)
Sets the HttpSession attribute value for the specified key |
static void |
setSessionAttribute(javax.servlet.ServletRequest req,
java.lang.String key,
java.lang.Object val)
Sets the ServletRequest attribute value for the specified key |
static void |
setSessionBoolean(javax.servlet.ServletRequest req,
java.lang.String key,
boolean val)
Sets the ServletRequest attribute Boolean value for the specified key |
static void |
setSessionDouble(javax.servlet.ServletRequest req,
java.lang.String key,
double val)
Sets the ServletRequest attribute Double value for the specified key |
static void |
setSessionInt(javax.servlet.ServletRequest req,
java.lang.String key,
int val)
Sets the ServletRequest attribute Int value for the specified key |
static void |
setSessionLong(javax.servlet.ServletRequest req,
java.lang.String key,
long val)
Sets the ServletRequest attribute Long value for the specified key |
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 ATTR_RTP
public static final java.lang.String ATTR_MULTIPART
public static final int MAX_BINARY_SIZE
public static final java.lang.String MIMEPART_NAME
public static final java.lang.String MIMEPART_FILENAME
public static final java.lang.String MIMEPART_FILE
public static final java.lang.String MIMEPART_STRING
public static final java.lang.String MIMEPART_BYTES
public static final java.lang.String MIMEPART_INCOMPLETE
Constructor Detail |
---|
public AttributeTools()
Method Detail |
---|
public static int GetSessionSequence(javax.servlet.http.HttpServletRequest request)
public static void printHeaders(javax.servlet.http.HttpServletRequest req, java.lang.String title)
public static void printParameters(javax.servlet.http.HttpServletRequest req, java.lang.String title)
public static boolean parseMultipartFormData(javax.servlet.http.HttpServletRequest request)
public static RTProperties getMultipartProperties(javax.servlet.http.HttpServletRequest request)
public static boolean hasMultipartFormData(javax.servlet.http.HttpServletRequest request)
public static boolean parseMultipartFormData(javax.servlet.http.HttpServletRequest request, int maxLen, java.io.File fileSaveDir)
protected static void _parseMultipartFormData(javax.servlet.http.HttpServletRequest request, int maxLen, java.io.File fileSaveDir) throws java.io.IOException
request
- The HttpServletRequestmaxLen
- The maximum number of bytes read from a MIME part ('-1' to disregard length limit)fileSaveDir
- The file directory where file types are saved (null to only store data in memory)
java.io.IOException
- If a IO error occurspublic static javax.servlet.http.HttpSession getSession(javax.servlet.ServletRequest req)
req
- The ServletRequest
public static javax.servlet.ServletContext getServletContext(javax.servlet.ServletRequest req)
req
- The ServletRequest
public static java.lang.String getContentType(javax.servlet.http.HttpServletRequest req)
req
- The request
public static int getContentLength(javax.servlet.http.HttpServletRequest req)
req
- The request
public static RTProperties parseRTP(javax.servlet.ServletRequest req)
req
- The ServletRequest
public static java.lang.String[] getMatchingKeys(javax.servlet.ServletRequest req, java.lang.String key_)
key_
- The parameter partial key
public static boolean hasRequestAttribute(javax.servlet.ServletRequest req, java.lang.String key)
req
- The ServletRequestkey
- The key to test
public static boolean hasRequestAttribute(javax.servlet.ServletRequest req, java.lang.String[] key)
req
- The ServletRequestkey
- An array of keys to test
public static java.lang.String getRequestString(javax.servlet.ServletRequest req, java.lang.String key, java.lang.String dft)
req
- The ServletRequestkey
- The key to testdft
- The default value to return if the key is not defined
public static java.lang.String getRequestString(javax.servlet.ServletRequest req, java.lang.String[] keyList, java.lang.String dft)
req
- The ServletRequestkeyList
- The keys to testdft
- The default value to return if the key is not defined
public static double getRequestDouble(javax.servlet.ServletRequest req, java.lang.String key, double dft)
req
- The ServletRequestkey
- The key to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Double.
public static double getRequestDouble(javax.servlet.ServletRequest req, java.lang.String[] key, double dft)
req
- The ServletRequestkey
- An array of keys to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Double.
public static long getRequestLong(javax.servlet.ServletRequest req, java.lang.String key, long dft)
req
- The ServletRequestkey
- The key to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Long.
public static long getRequestLong(javax.servlet.ServletRequest req, java.lang.String[] key, long dft)
req
- The ServletRequestkey
- An array of keys to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Long.
public static int getRequestInt(javax.servlet.ServletRequest req, java.lang.String key, int dft)
req
- The ServletRequestkey
- The key to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Int.
public static int getRequestInt(javax.servlet.ServletRequest req, java.lang.String[] key, int dft)
req
- The ServletRequestkey
- An array of keys to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Int.
public static boolean getRequestBoolean(javax.servlet.ServletRequest req, java.lang.String key, boolean dft)
req
- The ServletRequestkey
- The key to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Boolean.
public static boolean getRequestBoolean(javax.servlet.ServletRequest req, java.lang.String[] key, boolean dft)
req
- The ServletRequestkey
- An array of keys to testdft
- The default value to return if the key is not defined,
or cannot be converted to a Boolean.
public static boolean getRequestCheckbox(javax.servlet.ServletRequest req, java.lang.String key)
req
- The ServletRequestkey
- The key to test
public static boolean getRequestCheckbox(javax.servlet.ServletRequest req, java.lang.String[] key)
req
- The ServletRequestkey
- An array of keys to test
public static boolean hasSessionAttribute(javax.servlet.http.HttpSession sess, java.lang.String key)
key
- The attribute key to test
public static boolean hasSessionAttribute(javax.servlet.http.HttpSession sess, java.lang.String[] key)
key
- The attribute key to test
public static boolean hasSessionAttribute(javax.servlet.ServletRequest req, java.lang.String key)
key
- The attribute key to test
public static boolean hasSessionAttribute(javax.servlet.ServletRequest req, java.lang.String[] key)
key
- The attribute key to test
public static java.lang.Object getSessionAttribute(javax.servlet.http.HttpSession sess, java.lang.String key, java.lang.Object dft)
sess
- The HttpSessionkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined.
public static java.lang.Object getSessionAttribute(javax.servlet.http.HttpSession sess, java.lang.String[] key, java.lang.Object dft)
sess
- The HttpSessionkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined.
public static java.lang.Object getSessionAttribute(javax.servlet.ServletRequest req, java.lang.String key, java.lang.Object dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined.
public static java.lang.Object getSessionAttribute(javax.servlet.ServletRequest req, java.lang.String[] key, java.lang.Object dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined.
public static java.lang.String getSessionString(javax.servlet.ServletRequest req, java.lang.String key, java.lang.String dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined.
public static java.lang.String getSessionString(javax.servlet.ServletRequest req, java.lang.String[] key, java.lang.String dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined.
public static double getSessionDouble(javax.servlet.ServletRequest req, java.lang.String key, double dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Double.
public static double getSessionDouble(javax.servlet.ServletRequest req, java.lang.String[] key, double dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Double.
public static long getSessionLong(javax.servlet.ServletRequest req, java.lang.String key, long dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Long.
public static long getSessionLong(javax.servlet.ServletRequest req, java.lang.String[] key, long dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Long.
public static int getSessionInt(javax.servlet.ServletRequest req, java.lang.String key, int dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Int.
public static int getSessionInt(javax.servlet.ServletRequest req, java.lang.String[] key, int dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Int.
public static boolean getSessionBoolean(javax.servlet.ServletRequest req, java.lang.String key, boolean dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Boolean.
public static boolean getSessionBoolean(javax.servlet.ServletRequest req, java.lang.String[] key, boolean dft)
req
- The ServletRequestkey
- The key for which the attribute value will be returneddft
- The default value returns if the key is not defined,
or cannot be converted to a Boolean.
public static java.lang.Object getRequestAttribute(javax.servlet.ServletRequest req, java.lang.String key, java.lang.Object dft)
req
- The ServletRequestkey
- The key for which the value is to be returneddft
- The default value return if the key is not defined
public static java.lang.Object getRequestAttribute(javax.servlet.ServletRequest req, java.lang.String[] key, java.lang.Object dft)
req
- The ServletRequestkey
- The key for which the value is to be returneddft
- The default value return if the key is not defined
public static void setSessionAttribute(javax.servlet.http.HttpSession sess, java.lang.String key, java.lang.Object val)
sess
- The HttpSessionkey
- The attribute key to setval
- The value to set for the specified keypublic static void setSessionAttribute(javax.servlet.ServletRequest req, java.lang.String key, java.lang.Object val)
req
- The ServletRequestkey
- The attribute key to setval
- The value to set for the specified keypublic static void setSessionDouble(javax.servlet.ServletRequest req, java.lang.String key, double val)
req
- The ServletRequestkey
- The attribute key to setval
- The Double value to set for the specified keypublic static void setSessionLong(javax.servlet.ServletRequest req, java.lang.String key, long val)
req
- The ServletRequestkey
- The attribute key to setval
- The Long value to set for the specified keypublic static void setSessionInt(javax.servlet.ServletRequest req, java.lang.String key, int val)
req
- The ServletRequestkey
- The attribute key to setval
- The Int value to set for the specified keypublic static void setSessionBoolean(javax.servlet.ServletRequest req, java.lang.String key, boolean val)
req
- The ServletRequestkey
- The attribute key to setval
- The Boolean value to set for the specified keypublic static void clearSessionAttributes(javax.servlet.http.HttpSession sess)
sess
- The HttpSessionpublic static void clearSessionAttributes(javax.servlet.ServletRequest req)
req
- The ServletRequestpublic static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |