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
|
static String |
getStringParameter(javax.servlet.http.HttpServletRequest request,
String name,
String defaultVal)
Returns a parameter as a String.
|
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.name
- the name of the parameter you want to getpublic static String getStringParameter(javax.servlet.http.HttpServletRequest request, String name, String defaultVal)
request
- the HttpServletRequest object, known as "request" in a
JSP page.name
- the name of the parameter you want to getdefaultVal
- the value to use if the supplied parameter is not present or is emptypublic 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 getdefaultVal
- the default value if the parameter is not presentpublic 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 getdefaultNum
- the default value if the parameter is not present/could not be parsedpublic 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 getdefaultNum
- the default value if the parameter is not present/could not be parsedpublic 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 getdefaultNum
- the default value of a parameter, if the parameter
can't be converted into a long.public 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.defaultNum
- the default value if the attribute is not present/cannot be parsedpublic 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.defaultNum
- the default value if the attribute is not present/cannot be parsedCopyright © 2003–2019 Ignite Realtime. All rights reserved.