public class ParamUtils extends Object
Constructor and Description |
---|
ParamUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getAttribute(javax.servlet.http.HttpServletRequest request,
String name)
Returns an attribute as a string.
|
static String |
getAttribute(javax.servlet.http.HttpServletRequest request,
String name,
boolean emptyStringsOK)
Returns an attribute as a string.
|
static boolean |
getBooleanAttribute(javax.servlet.http.HttpServletRequest request,
String name)
Returns an attribute as a boolean.
|
static boolean |
getBooleanParameter(javax.servlet.http.HttpServletRequest request,
String name)
Returns a parameter as a boolean.
|
static boolean |
getBooleanParameter(javax.servlet.http.HttpServletRequest request,
String name,
boolean defaultVal)
Returns a parameter as a boolean.
|
static double |
getDoubleParameter(javax.servlet.http.HttpServletRequest request,
String name,
double defaultNum)
Returns a parameter as a double.
|
static int |
getIntAttribute(javax.servlet.http.HttpServletRequest request,
String name,
int defaultNum)
Returns an attribute as a int.
|
static int |
getIntParameter(javax.servlet.http.HttpServletRequest request,
String name,
int defaultNum)
Returns a parameter as an int.
|
static int[] |
getIntParameters(javax.servlet.http.HttpServletRequest request,
String name,
int defaultNum)
Returns a list of int parameters.
|
static long |
getLongAttribute(javax.servlet.http.HttpServletRequest request,
String name,
long defaultNum)
Returns an attribute as a long.
|
static long |
getLongParameter(javax.servlet.http.HttpServletRequest request,
String name,
long defaultNum)
Returns a parameter as a long.
|
static long[] |
getLongParameters(javax.servlet.http.HttpServletRequest request,
String name,
long defaultNum)
Returns a list of long parameters.
|
static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name)
Returns a parameter as a string.
|
static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name,
boolean emptyStringsOK)
Returns a parameter as a string.
|
static String[] |
getParameters(javax.servlet.http.HttpServletRequest request,
String name)
Returns a list of parameters of the same name
|
public static String getParameter(javax.servlet.http.HttpServletRequest request, String name)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getpublic static String getParameter(javax.servlet.http.HttpServletRequest request, String name, boolean emptyStringsOK)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getemptyStringsOK
- return the parameter values even if it is an empty string.public static String[] getParameters(javax.servlet.http.HttpServletRequest request, String name)
request
- an HttpServletRequest object.public static boolean getBooleanParameter(javax.servlet.http.HttpServletRequest request, String name)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getpublic static boolean getBooleanParameter(javax.servlet.http.HttpServletRequest request, String name, boolean defaultVal)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getpublic static int getIntParameter(javax.servlet.http.HttpServletRequest request, String name, int defaultNum)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getpublic static int[] getIntParameters(javax.servlet.http.HttpServletRequest request, String name, int defaultNum)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getdefaultNum
- the default value of a parameter, if the parameter
can't be converted into an int.public static double getDoubleParameter(javax.servlet.http.HttpServletRequest request, String name, double defaultNum)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getpublic static long getLongParameter(javax.servlet.http.HttpServletRequest request, String name, long defaultNum)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getpublic static long[] getLongParameters(javax.servlet.http.HttpServletRequest request, String name, long defaultNum)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getdefaultNum
- the default value of a parameter, if the parameter
can't be converted into a long.public static String getAttribute(javax.servlet.http.HttpServletRequest request, String name)
request
- the HttpServletRequest object, known as "request" in a JSP page.name
- the name of the parameter you want to getpublic static String getAttribute(javax.servlet.http.HttpServletRequest request, String name, boolean emptyStringsOK)
request
- the HttpServletRequest object, known as "request" in a JSP page.name
- the name of the parameter you want to get.emptyStringsOK
- return the parameter values even if it is an empty string.public static boolean getBooleanAttribute(javax.servlet.http.HttpServletRequest request, String name)
request
- the HttpServletRequest object, known as "request" in a JSP page.name
- the name of the attribute you want to get.public static int getIntAttribute(javax.servlet.http.HttpServletRequest request, String name, int defaultNum)
request
- the HttpServletRequest object, known as "request" in a JSP page.name
- the name of the attribute you want to get.public static long getLongAttribute(javax.servlet.http.HttpServletRequest request, String name, long defaultNum)
request
- the HttpServletRequest object, known as "request" in a JSP page.name
- the name of the attribute you want to get.Copyright © 2003-2008 Jive Software.