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


Method Index

 o addParameter(String, String)
Add a new parameter, or set the value of an existing one.
 o addParameterValues(String, String[])
Add a new multi-valued parameter, or set the value(s) of an existing one.
 o checkParameters(String[], boolean)
Check the presence of a list of parameters
 o getAllParams()
Get all the parameters.
 o 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).
 o 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).
 o 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.
 o getParameterNames()
Get all the parameter names.
 o getParameterValues(String)
Get a multi-valued parameter's values.
 o getServletRequest()
Get the servlet's HttpServletRequest.
The HttpServletRequest contains only the HTTP parameters.
 o toString()
Convert this object into a String, mostly for debug purposes.

Methods

 o 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.
 o 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
 o 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
 o 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
 o 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.
 o 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)
 o 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
 o getParameterNames
 public Enumeration getParameterNames()
Get all the parameter names.

Returns:
An Enumeration that contains the parameter names.
 o getAllParams
 public Hashtable getAllParams()
Get all the parameters.

Returns:
A Hashtable that contains the parameters, as name/value pairs.
 o 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
 o 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