|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.gui.legacy.util.RequestUtils
WebUtility
@Deprecated public class RequestUtils
Utilities class that provides many convenience methods for logging, request parameter processing, etc.
| Constructor Summary | |
|---|---|
RequestUtils()
Deprecated. |
|
| Method Summary | |
|---|---|
static void |
bustaCache(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Deprecated. |
static void |
bustaCache(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
boolean expire)
Deprecated. When you really really want to defeat a browser's cache, expire the content and set the no-cache header |
static String |
dumpRequestAttributesToString(javax.servlet.ServletRequest request)
Deprecated. |
static void |
dumpRequestAttributesToString(javax.servlet.ServletRequest request,
OutputStream out)
Deprecated. |
static void |
dumpRequestAttributesToString(javax.servlet.ServletRequest request,
PrintWriter out)
Deprecated. |
static void |
dumpRequestParams(javax.servlet.ServletRequest request,
org.apache.commons.logging.Log log,
boolean html)
Deprecated. |
static void |
dumpRequestParams(javax.servlet.ServletRequest request,
OutputStream out,
boolean html)
Deprecated. |
static void |
dumpRequestParams(javax.servlet.ServletRequest request,
PrintWriter out,
boolean html)
Deprecated. A development aid. |
static String |
dumpRequestParamsToString(javax.servlet.ServletRequest request,
boolean html)
Deprecated. |
static Integer |
getAutogroupResourceTypeId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the AUTOGROUP_TYPE_ID_PARAM parameter from the HTTP
request. |
static org.rhq.core.domain.resource.group.GroupCategory |
getGroupCategory(javax.servlet.http.HttpServletRequest request)
Deprecated. |
static Integer |
getGroupId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the RESOURCE_PARAM parameter from the HTTP request. |
static Integer |
getIntParameter(javax.servlet.http.HttpServletRequest request,
String name)
Deprecated. Fetchs the int value of the parameter from the request |
static Integer |
getIntParameter(javax.servlet.http.HttpServletRequest request,
String name,
Integer def)
Deprecated. Fetchs the int value of the parameter from the request |
static Integer |
getMetricId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the METRIC_BASELINE_PARAM parameter from the HTTP
request. |
static String |
getMode(javax.servlet.http.HttpServletRequest request)
Deprecated. Extract the subcontroller mode from the Constants.MODE_PARAM parameter of the HTTP request. |
static int |
getPageNum(javax.servlet.http.HttpServletRequest request,
String param)
Deprecated. Retrieve the int value of the Constants.PAGENUM_PARAM request parameter, or
Constants.PAGENUM_DEFAULT if the parameter was not found or not specified as an integer. |
static int |
getPageSize(javax.servlet.http.HttpServletRequest request,
String param)
Deprecated. Retrieve the int value of the Constants.PAGESIZE_PARAM request parameter, or
Constants.PAGESIZE_DEFAULT if the parameter was not found or not specified as an integer. |
static org.rhq.core.domain.resource.Resource |
getRes(javax.servlet.http.HttpServletRequest request)
Deprecated. |
static org.rhq.core.domain.resource.Resource |
getResource(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Resource value of the RESOURCE_ATTR parameter from the HTTP request. |
static org.rhq.core.domain.resource.group.ResourceGroup |
getResourceGroupIfExists(javax.servlet.http.HttpServletRequest request)
Deprecated. |
static Integer |
getResourceId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the RESOURCE_ID_PARAM parameter from the HTTP
request. |
static Integer[] |
getResourceIds(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer values of the RESOURCE_ID_PARAM parameter from the HTTP
request. |
static org.rhq.core.domain.resource.ResourceType |
getResourceType(javax.servlet.http.HttpServletRequest request)
Deprecated. |
static Integer |
getResourceTypeId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the RESOURCE_TYPE_ID_PARAM parameter from the HTTP
request. |
static Integer |
getRoleId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the ROLE_PARAM parameter from the HTTP request. |
static Integer |
getScheduleId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the SCHEDULE_PARAM parameter from the HTTP request. |
static Integer |
getSessionId(javax.servlet.http.HttpServletRequest request)
Deprecated. Extract the BizApp session id as an Integer from the web session. |
static String |
getStringParameter(javax.servlet.http.HttpServletRequest request,
String name)
Deprecated. Fetches the String value of the parameter from the request |
static String |
getStringParameter(javax.servlet.http.HttpServletRequest request,
String name,
String def)
Deprecated. Fetchs the String value of the parameter from the request |
static org.rhq.core.domain.auth.Subject |
getSubject(javax.servlet.http.HttpServletRequest request)
Deprecated. Use WebUtility.getSubject(HttpServletRequest) instead |
static String |
getUrl(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the String value of the URL_ATTR parameter from the HTTP request. |
static Integer |
getUserId(javax.servlet.http.HttpServletRequest request)
Deprecated. Retrieve the Integer value of the USER_PARAM parameter from the HTTP request. |
static WebUser |
getWebUser(javax.servlet.http.HttpServletRequest request)
Deprecated. Return the WebUser representing the person currently interacting with the product. |
static boolean |
isAddClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if an "add" button was clicked on the previous page. |
static boolean |
isCancelClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if an "cancel" button was clicked on the previous page. |
static boolean |
isEditClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if an "edit" button was clicked on the previous page. |
static boolean |
isNewClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if an "new" button was clicked on the previous page. |
static boolean |
isOkAssignClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if an "okassign" button was clicked on the previous page. |
static boolean |
isOkClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if an "ok" button was clicked on the previous page. |
static boolean |
isRemoveClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if a "remove" button was clicked on the previous page. |
static boolean |
isResetClicked(javax.servlet.http.HttpServletRequest request)
Deprecated. Examine the request to see if an "reset" button was clicked on the previous page. |
static String |
message(javax.servlet.http.HttpServletRequest request,
String key)
Deprecated. Get an i18n message from the application resource bundle. |
static String |
message(javax.servlet.http.HttpServletRequest request,
String key,
Object[] args)
Deprecated. Get an i18n message from the application resource bundle. |
static String |
message(javax.servlet.http.HttpServletRequest request,
String bundle,
String locale,
String key)
Deprecated. Get an i18n message from the application resource bundle. |
static String |
message(javax.servlet.http.HttpServletRequest request,
String bundle,
String locale,
String key,
Object[] args)
Deprecated. Get an i18n message from the application resource bundle. |
static boolean |
parameterExists(javax.servlet.http.HttpServletRequest request,
String name)
Deprecated. Verify if a parameter exists in the request |
static void |
propogateParam(javax.servlet.http.HttpServletRequest request,
Map params,
String param)
Deprecated. Propogate a request parameter. |
static void |
setConfirmation(javax.servlet.http.HttpServletRequest request,
String key)
Deprecated. Set a confirmation message upon completion of a user action. |
static void |
setConfirmation(javax.servlet.http.HttpServletRequest request,
String key,
Object value0)
Deprecated. Set a confirmation message with a replacement value upon completion of a user action. |
static void |
setError(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionMessage msg,
String property)
Deprecated. |
static void |
setError(javax.servlet.http.HttpServletRequest request,
String key)
Deprecated. Set an error message when a user action fails with a user-level error. |
static void |
setError(javax.servlet.http.HttpServletRequest request,
String key,
Object value0)
Deprecated. Set an error message with a replacement value when a user action fails with a user-level error. |
static void |
setError(javax.servlet.http.HttpServletRequest request,
String key,
Object value0,
String property)
Deprecated. Set an error message with a replacement value when a user action fails with a user-level error. |
static void |
setError(javax.servlet.http.HttpServletRequest request,
String key,
String property)
Deprecated. Set an error message when a user action fails with a user-level error. |
static void |
setErrorObject(javax.servlet.http.HttpServletRequest request,
String key,
String object)
Deprecated. Set an error message when a user action fails with a user-level error. |
static void |
setErrors(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionErrors errs)
Deprecated. sets an ActionErrors object into the request object. |
static void |
setErrorWithNullCheck(javax.servlet.http.HttpServletRequest request,
Exception e,
String nullMsg,
String regularMsg)
Deprecated. |
static void |
setGroupCategory(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.group.GroupCategory category)
Deprecated. |
static void |
setRes(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.Resource resource)
Deprecated. |
static void |
setResource(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.Resource resource)
Deprecated. Set the Resource value in the RESOURCE_ATTR parameter of the HTTP request. |
static void |
setResourceGroup(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.group.ResourceGroup resourceGroup)
Deprecated. |
static void |
setResourceType(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.ResourceType resourceType)
Deprecated. Set the Resource value in the RESOURCE_ATTR parameter of the HTTP request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestUtils()
| Method Detail |
|---|
public static boolean parameterExists(javax.servlet.http.HttpServletRequest request,
String name)
name - The name of the parameter in the request
public static String getStringParameter(javax.servlet.http.HttpServletRequest request,
String name)
throws ParameterNotFoundException
name - The name of the parameter in the request
ParameterNotFoundException - If the parameter name is not found in the request
public static String getStringParameter(javax.servlet.http.HttpServletRequest request,
String name,
String def)
name - The name of the parameter in the requestdef - The default value to return if the parameter is not found
public static Integer getIntParameter(javax.servlet.http.HttpServletRequest request,
String name)
throws ParameterNotFoundException,
NumberFormatException
name - The name of the parameter in the request
ParameterNotFoundException - If the parameter name is not found in the request
NumberFormatException - If the parameter value is not a valid integer
public static Integer getIntParameter(javax.servlet.http.HttpServletRequest request,
String name,
Integer def)
name - The name of the parameter in the requestdef - The default value to return if the parameter is not found
public static WebUser getWebUser(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
WebUser representing the person currently interacting with the product.
javax.servlet.ServletException - if the session cannot be accessed
@Deprecated
public static org.rhq.core.domain.auth.Subject getSubject(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
WebUtility.getSubject(HttpServletRequest) instead
Subject representing the person currently interacting with the product.
javax.servlet.ServletException - if the session cannot be accessed
public static Integer getSessionId(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
Integer from the web session.
javax.servlet.ServletException - if the session cannot be accessedpublic static String getMode(javax.servlet.http.HttpServletRequest request)
Constants.MODE_PARAM parameter of the HTTP request.
public static Integer getRoleId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the ROLE_PARAM parameter from the HTTP request.
ParameterNotFoundException - if the parameter was not specifiedpublic static org.rhq.core.domain.resource.Resource getResource(javax.servlet.http.HttpServletRequest request)
Resource value of the RESOURCE_ATTR parameter from the HTTP request.
If the resource is not cached in the request, set a user error and return null.
public static void setResource(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.Resource resource)
Resource value in the RESOURCE_ATTR parameter of the HTTP request.
public static void setResourceType(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.ResourceType resourceType)
Resource value in the RESOURCE_ATTR parameter of the HTTP request.
public static Integer getGroupId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the RESOURCE_PARAM parameter from the HTTP request.
ParameterNotFoundException - if the parameter was not specified
public static org.rhq.core.domain.resource.group.GroupCategory getGroupCategory(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
ParameterNotFoundException
public static void setGroupCategory(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.group.GroupCategory category)
public static org.rhq.core.domain.resource.group.ResourceGroup getResourceGroupIfExists(javax.servlet.http.HttpServletRequest request)
public static void setResourceGroup(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.group.ResourceGroup resourceGroup)
public static org.rhq.core.domain.resource.Resource getRes(javax.servlet.http.HttpServletRequest request)
public static void setRes(javax.servlet.http.HttpServletRequest request,
org.rhq.core.domain.resource.Resource resource)
public static void setErrorWithNullCheck(javax.servlet.http.HttpServletRequest request,
Exception e,
String nullMsg,
String regularMsg)
public static Integer getResourceId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the RESOURCE_ID_PARAM parameter from the HTTP
request.
ParameterNotFoundException - if the parameter was not specified
public static Integer[] getResourceIds(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer values of the RESOURCE_ID_PARAM parameter from the HTTP
request.
ParameterNotFoundException - if the parameter was not specified
public static Integer getScheduleId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the SCHEDULE_PARAM parameter from the HTTP request.
ParameterNotFoundException - if the parameter was not specified
public static Integer getResourceTypeId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the RESOURCE_TYPE_ID_PARAM parameter from the HTTP
request.
ParameterNotFoundException - if the parameter was not specifiedpublic static org.rhq.core.domain.resource.ResourceType getResourceType(javax.servlet.http.HttpServletRequest request)
public static Integer getAutogroupResourceTypeId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the AUTOGROUP_TYPE_ID_PARAM parameter from the HTTP
request.
ParameterNotFoundException - if the parameter was not specified
public static Integer getUserId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the USER_PARAM parameter from the HTTP request.
ParameterNotFoundException - if the parameter was not specified
public static Integer getMetricId(javax.servlet.http.HttpServletRequest request)
throws ParameterNotFoundException
Integer value of the METRIC_BASELINE_PARAM parameter from the HTTP
request.
ParameterNotFoundException - if the parameter was not specifiedpublic static String getUrl(javax.servlet.http.HttpServletRequest request)
String value of the URL_ATTR parameter from the HTTP request.
ParameterNotFoundException - if the parameter was not specified
public static int getPageNum(javax.servlet.http.HttpServletRequest request,
String param)
int value of the Constants.PAGENUM_PARAM request parameter, or
Constants.PAGENUM_DEFAULT if the parameter was not found or not specified as an integer.
public static int getPageSize(javax.servlet.http.HttpServletRequest request,
String param)
int value of the Constants.PAGESIZE_PARAM request parameter, or
Constants.PAGESIZE_DEFAULT if the parameter was not found or not specified as an integer.
public static void setConfirmation(javax.servlet.http.HttpServletRequest request,
String key)
key - the message resource key
public static void setConfirmation(javax.servlet.http.HttpServletRequest request,
String key,
Object value0)
key - the message resource keyvalue0 - the replacement value
public static void setError(javax.servlet.http.HttpServletRequest request,
String key)
key - the message resource key
public static void setError(javax.servlet.http.HttpServletRequest request,
String key,
String property)
key - the message resource keyproperty - the form property for which the error occurred
public static void setErrorObject(javax.servlet.http.HttpServletRequest request,
String key,
String object)
key - the message resource keyproperty - the form property for which the error occurred
public static void setError(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionMessage msg,
String property)
public static void setErrors(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionErrors errs)
public static void setError(javax.servlet.http.HttpServletRequest request,
String key,
Object value0)
key - the message resource keyvalue0 - the replacement value
public static void setError(javax.servlet.http.HttpServletRequest request,
String key,
Object value0,
String property)
key - the message resource keyvalue0 - the replacement valueproperty - the form property for which the error occurredpublic static boolean isCancelClicked(javax.servlet.http.HttpServletRequest request)
Constants.CANCEL_PARAM or Constants.CANCEL_X_PARAM parameters will exist.
public static boolean isOkClicked(javax.servlet.http.HttpServletRequest request)
Constants.OK_PARAM or Constants.OK_X_PARAM parameters will exist.
public static boolean isOkAssignClicked(javax.servlet.http.HttpServletRequest request)
Constants.OK_ASSIGN_PARAM or Constants.OK_ASSIGN_X_PARAM parameters will exist.
public static boolean isResetClicked(javax.servlet.http.HttpServletRequest request)
Constants.RESET_PARAM or Constants.RESET_X_PARAM parameters will exist.
public static boolean isNewClicked(javax.servlet.http.HttpServletRequest request)
Constants.NEW_PARAM or Constants.NEW_X_PARAM parameters will exist.
public static boolean isEditClicked(javax.servlet.http.HttpServletRequest request)
Constants.EDIT_PARAM or Constants.EDIT_X_PARAM parameters will exist.
public static boolean isAddClicked(javax.servlet.http.HttpServletRequest request)
Constants.ADD_PARAM or Constants.ADD_X_PARAM parameters will exist.
public static boolean isRemoveClicked(javax.servlet.http.HttpServletRequest request)
Constants.REMOVE_PARAM or Constants.REMOVE_X_PARAM parameters will exist.
public static void propogateParam(javax.servlet.http.HttpServletRequest request,
Map params,
String param)
params - the parameters passed to the ActionForwardparam - the parameter name to propogate
public static String message(javax.servlet.http.HttpServletRequest request,
String key)
key - the message key we want
public static String message(javax.servlet.http.HttpServletRequest request,
String key,
Object[] args)
key - the message key we wantargs - the positional parameters for the message
public static String message(javax.servlet.http.HttpServletRequest request,
String bundle,
String locale,
String key)
bundle - the resource bundle namebundle - the user localekey - the message key we want
public static String message(javax.servlet.http.HttpServletRequest request,
String bundle,
String locale,
String key,
Object[] args)
bundle - the resource bundle namebundle - the user localekey - the message key we wantargs - the positional parameters for the message
public static void bustaCache(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
public static void bustaCache(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
boolean expire)
expire - set true to have the content expire immediately
public static void dumpRequestParams(javax.servlet.ServletRequest request,
PrintWriter out,
boolean html)
out - output the parameter dump to a PrintWriterhtml - formats the dump with <ol> if true
public static void dumpRequestParams(javax.servlet.ServletRequest request,
OutputStream out,
boolean html)
public static void dumpRequestParams(javax.servlet.ServletRequest request,
org.apache.commons.logging.Log log,
boolean html)
public static String dumpRequestParamsToString(javax.servlet.ServletRequest request,
boolean html)
public static String dumpRequestAttributesToString(javax.servlet.ServletRequest request)
public static void dumpRequestAttributesToString(javax.servlet.ServletRequest request,
PrintWriter out)
public static void dumpRequestAttributesToString(javax.servlet.ServletRequest request,
OutputStream out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||