|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlazyj.RequestWrapper
public final class RequestWrapper
This utility class is adapted for JSP use, offering easy access to the parameters and file uploading.
| Constructor Summary | |
|---|---|
RequestWrapper(javax.servlet.http.HttpServletRequest request)
Initialize the class with a HttpServletRequest |
|
| Method Summary | |
|---|---|
java.lang.String |
esc(java.lang.String sName)
Get the SQL-safe value of this parameter |
boolean |
getb(java.lang.String sName,
boolean bDefault)
Get the boolean value |
java.lang.String |
getCookie(java.lang.String sName)
Get the value of a specific cookie |
double |
getd(java.lang.String sParam)
Get the value of a parameter as a double value. |
double |
getd(java.lang.String sParam,
double defaultVal)
Get the value of a parameter as a double value. |
float |
getf(java.lang.String sParam)
Get the value of a parameter as a float value. |
float |
getf(java.lang.String sParam,
float defaultVal)
Get the value of a parameter as a float value. |
int |
geti(java.lang.String sParam)
Get the value of a parameter as an integer value. |
int |
geti(java.lang.String sParam,
int defaultVal)
Get the value of a parameter as an integer value. |
long |
getl(java.lang.String sParam)
Get the value of a parameter as a long value. |
long |
getl(java.lang.String sParam,
long defaultVal)
Get the value of a parameter as a long value. |
java.lang.String |
gets(java.lang.String sParam)
Get the value of a parameter as a string. |
java.lang.String |
gets(java.lang.String sParam,
java.lang.String sDefault)
Get the value of a parameter as a string |
java.lang.String[] |
getValues(java.lang.String sParam)
Get all the values of a parameter. |
com.oreilly.servlet.MultipartRequest |
initMultipartRequest(java.lang.String sTempDir,
int iFileSizeLimit)
This method should be called when the servlet expects a file upload from the client. |
static void |
setCacheTimeout(javax.servlet.http.HttpServletResponse response,
int seconds)
Set the caching timeout for some generated content. |
static void |
setNotCache(javax.servlet.http.HttpServletResponse response)
Make this response uncacheable by the browser / proxies on the way |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestWrapper(javax.servlet.http.HttpServletRequest request)
HttpServletRequest
request - | Method Detail |
|---|
public com.oreilly.servlet.MultipartRequest initMultipartRequest(java.lang.String sTempDir,
int iFileSizeLimit)
sTempDir - temporary folder for the files that are uploadediFileSizeLimit - maximum size of a file
public java.lang.String[] getValues(java.lang.String sParam)
sParam -
public java.lang.String gets(java.lang.String sParam)
sParam - the parameter name
public java.lang.String gets(java.lang.String sParam,
java.lang.String sDefault)
sParam - parameter namesDefault - default value to return in case the parameter is not defined or has no value ("")
public int geti(java.lang.String sParam,
int defaultVal)
sParam - the name of the parameterdefaultVal - default value to return in case of an error
public int geti(java.lang.String sParam)
sParam - name of the parameter
public long getl(java.lang.String sParam,
long defaultVal)
sParam - the name of the parameterdefaultVal - default value to return in case of an error
public long getl(java.lang.String sParam)
sParam - name of the parameter
public float getf(java.lang.String sParam,
float defaultVal)
sParam - the name of the parameterdefaultVal - default value to return in case of an error
public float getf(java.lang.String sParam)
sParam - name of the parameter
public double getd(java.lang.String sParam,
double defaultVal)
sParam - the name of the parameterdefaultVal - default value to return in case of an error
public double getd(java.lang.String sParam)
sParam - name of the parameter
public java.lang.String getCookie(java.lang.String sName)
sName - the name of the cookie
public boolean getb(java.lang.String sName,
boolean bDefault)
sName - parameter namebDefault - default value
public java.lang.String esc(java.lang.String sName)
sName - URL parameter name
public static void setNotCache(javax.servlet.http.HttpServletResponse response)
response -
public static void setCacheTimeout(javax.servlet.http.HttpServletResponse response,
int seconds)
response - the response objectseconds - expiration time, in seconds relative to "now". A strict positive value
would enable the caching while a zero or negative one would disable the caching.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||