All Packages Class Hierarchy This Package Previous Next Index
Class com.expershop.esapi.ServletRequest
java.lang.Object
|
+----com.expershop.esapi.ServletRequest
- public class ServletRequest
- extends Object
An ExperSHOP servlet request
-
addParameter(String, String)
- Add a new parameter, or set the value of an existing one.
-
addParameterValues(String, String[])
- Add a new multi-valued parameter, or set the value(s) of an existing one.
-
checkParameters(String[], boolean)
- Check the presence of a list of parameters
-
getAllParams()
- Get all the parameters.
-
getDoubleParam(String, double)
- Equivalent to getParameter(), but for double values only.
Returns the double parameter value, or the value specified in the errval
parameter if an error occurs (like a parse error, if the parameter is not
a double).
-
getIntParam(String, int)
- Equivalent to getParameter(), but for integer values only.
Returns the integer parameter value, or the value specified in the errval
parameter if an error occurs (like a parse error, if the parameter is not
an integer).
-
getParameter(String)
- Get a parameter value, given its name.
Parameters can be HTTP parameters (for example, submitted in an HTML form)
or parameters set using either $Assign in a template or the addParameter()
method.
-
getParameterNames()
- Get all the parameter names.
-
getParameterValues(String)
- Get a multi-valued parameter's values.
-
getServletRequest()
- Get the servlet's HttpServletRequest.
The HttpServletRequest contains only the HTTP parameters.
-
toString()
- Convert this object into a String, mostly for debug purposes.
getParameter
public String getParameter(String name)
- Get a parameter value, given its name.
Parameters can be HTTP parameters (for example, submitted in an HTML form)
or parameters set using either $Assign in a template or the addParameter()
method.
- Parameters:
- name - The parameter name
- Returns:
- The parameter value, or null if the parameter is not present.
getIntParam
public int getIntParam(String name,
int errval)
- Equivalent to getParameter(), but for integer values only.
Returns the integer parameter value, or the value specified in the errval
parameter if an error occurs (like a parse error, if the parameter is not
an integer).
- Parameters:
- name - The parameter name
- errval - The value to return if an error occurs (for example, -1)
- Returns:
- The parameter value, or errval if an error occurs
getDoubleParam
public double getDoubleParam(String name,
double errval)
- Equivalent to getParameter(), but for double values only.
Returns the double parameter value, or the value specified in the errval
parameter if an error occurs (like a parse error, if the parameter is not
a double).
- Parameters:
- name - The parameter name
- errval - The value to return if an error occurs (for example, -1)
- Returns:
- The parameter value, or errval if an error occurs
addParameter
public void addParameter(String name,
String val)
- Add a new parameter, or set the value of an existing one.
- Parameters:
- name - the parameter name
- val - the parameter value
getParameterValues
public String[] getParameterValues(String name)
- Get a multi-valued parameter's values.
- Returns:
- The parameter value(s), or null if the parameter is not present.
addParameterValues
public void addParameterValues(String name,
String val[])
- Add a new multi-valued parameter, or set the value(s) of an existing one.
- Parameters:
- name - the parameter name
- val - the parameter value(s)
checkParameters
public String checkParameters(String names[],
boolean all)
- Check the presence of a list of parameters
- Parameters:
- names - The parameter names
- all - If true, return the list of all missing parameters; If false,
return only the 1st missing parameter name.
- Returns:
- The name of the first undefined parameter, null if they are
all defined
getParameterNames
public Enumeration getParameterNames()
- Get all the parameter names.
- Returns:
- An Enumeration that contains the parameter names.
getAllParams
public Hashtable getAllParams()
- Get all the parameters.
- Returns:
- A Hashtable that contains the parameters, as name/value pairs.
toString
public String toString()
- Convert this object into a String, mostly for debug purposes.
- Returns:
- A String that reflects this object's content.
- Overrides:
- toString in class Object
getServletRequest
public HttpServletRequest getServletRequest()
- Get the servlet's HttpServletRequest.
The HttpServletRequest contains only the HTTP parameters.
- Returns:
- A javax.servlet.http.HttpServletRequest object
All Packages Class Hierarchy This Package Previous Next Index