|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jfw.web.util.RequestUtils
public final class RequestUtils
Implements methods for manage request parameters. All methods are static and thread safe.
Field Summary | |
---|---|
static java.lang.String |
PARAMETERS_KEY
The key to use for add the HashMap with the request parameters in an other HashMap (the one defined in JFWAction.myExecute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionMessages, java.util.HashMap) ). |
Constructor Summary | |
---|---|
RequestUtils()
|
Method Summary | |
---|---|
static java.lang.Object |
getValue(javax.servlet.http.HttpServletRequest request,
java.lang.String name,
java.lang.Object defaultValue)
Get the value of parameter. |
static void |
setGzipFilter(javax.servlet.http.HttpServletRequest request,
boolean filter)
Set attribute gzip in request. |
static void |
setParameters(javax.servlet.http.HttpServletRequest request,
java.util.HashMap outputData,
java.lang.String[] exclude)
Add directly in outputData all the requests parameters. |
static void |
setParametersList(javax.servlet.http.HttpServletRequest request,
java.util.HashMap outputData,
java.lang.String[] exclude)
Add in outputData, under key PARAMETERS_KEY , all the requests
parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PARAMETERS_KEY
JFWAction.myExecute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionMessages, java.util.HashMap)
).
Constructor Detail |
---|
public RequestUtils()
Method Detail |
---|
public static java.lang.Object getValue(javax.servlet.http.HttpServletRequest request, java.lang.String name, java.lang.Object defaultValue)
request
- an HttpServletRequest object.name
- parameter name.defaultValue
- the default value if parameter not found in request.
public static void setParametersList(javax.servlet.http.HttpServletRequest request, java.util.HashMap outputData, java.lang.String[] exclude)
PARAMETERS_KEY
, all the requests
parameters. If some parameters must be excluded then exclude must
contain the names of that parameters.
<%@ taglib uri="/WEB-INF/mytaglib.tld" prefix="mtl" %>
...
<form name="mainform">
<mtl:generic>
<?repeat input_parameters?>
<input type="hidden" name="<?name?>" value="<?value?>">
</repeat>
</mtl:generic>
</form>
request
- an HttpServletRequest object.outputData
- the HashMap defined in JFWAction.myExecute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionMessages, java.util.HashMap)
.exclude
- the names of parameters to exclude.public static void setParameters(javax.servlet.http.HttpServletRequest request, java.util.HashMap outputData, java.lang.String[] exclude)
<%@ taglib uri="/WEB-INF/mytaglib.tld" prefix="mtl" %>
...
<form name="mainform">
<mtl:generic>
<input type="hidden" name="PARAMETER_NAME_1" value="<?PARAMETER_NAME_1?>">
<input type="hidden" name="PARAMETER_NAME_2" value="<?PARAMETER_NAME_2?>">
</mtl:generic>
</form>
request
- an HttpServletRequest object.outputData
- the HashMap defined in JFWAction.myExecute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionMessages, java.util.HashMap)
.exclude
- the names of parameters to exclude.public static void setGzipFilter(javax.servlet.http.HttpServletRequest request, boolean filter)
request
- an HttpServletRequest object.filter
- a boolean with the value to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |