java.lang.Object
org.apache.struts.validator.Resources
- public class Resources
- extends java.lang.Object
This class helps provides some useful methods for retrieving objects
from different scopes of the application.
- Since:
- Struts 1.1
- Version:
- $Rev: 164530 $ $Date: 2005-04-25 04:11:07 +0100 (Mon, 25 Apr 2005) $
|
Method Summary |
static org.apache.struts.action.ActionError |
getActionError(javax.servlet.http.HttpServletRequest request,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
Deprecated. Use getActionMessage() instead. This will be removed after
Struts 1.2. |
static org.apache.struts.action.ActionMessage |
getActionMessage(javax.servlet.http.HttpServletRequest request,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
Gets the ActionMessage based on the
ValidatorAction message and the Field's
arg objects. |
static org.apache.struts.action.ActionMessage |
getActionMessage(org.apache.commons.validator.Validator validator,
javax.servlet.http.HttpServletRequest request,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
Gets the ActionMessage based on the
ValidatorAction message and the Field's
arg objects. |
static java.lang.String[] |
getArgs(java.lang.String actionName,
org.apache.struts.util.MessageResources messages,
java.util.Locale locale,
org.apache.commons.validator.Field field)
Gets the message arguments based on the current
ValidatorAction and Field. |
private static java.lang.String[] |
getArgValues(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
org.apache.struts.util.MessageResources defaultMessages,
java.util.Locale locale,
org.apache.commons.validator.Arg[] args)
Gets the message arguments based on the current
ValidatorAction and Field. |
static java.util.Locale |
getLocale(javax.servlet.http.HttpServletRequest request)
Deprecated. Use RequestUtils.getUserLocale() instead. This will be removed
after Struts 1.2. |
static java.lang.String |
getMessage(javax.servlet.http.HttpServletRequest request,
java.lang.String key)
Gets the Locale sensitive value based on the key passed in. |
static java.lang.String |
getMessage(org.apache.struts.util.MessageResources messages,
java.util.Locale locale,
java.lang.String key)
Gets the Locale sensitive value based on the key passed in. |
static java.lang.String |
getMessage(org.apache.struts.util.MessageResources messages,
java.util.Locale locale,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
Gets the locale sensitive message based on the
ValidatorAction message and the Field's
arg objects. |
static java.lang.String |
getMessage(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
org.apache.struts.util.MessageResources defaultMessages,
java.util.Locale locale,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
Gets the Locale sensitive value based on the key passed in. |
static org.apache.struts.util.MessageResources |
getMessageResources(javax.servlet.http.HttpServletRequest request)
Retrieve MessageResources for the module. |
static org.apache.struts.util.MessageResources |
getMessageResources(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
java.lang.String bundle)
Retrieve MessageResources for the module and bundle. |
static org.apache.commons.validator.ValidatorResources |
getValidatorResources(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request)
Retrieve ValidatorResources for the current module. |
static org.apache.commons.validator.Validator |
initValidator(java.lang.String key,
java.lang.Object bean,
javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionMessages errors,
int page)
Initialize the Validator to perform validation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERVLET_CONTEXT_PARAM
private static java.lang.String SERVLET_CONTEXT_PARAM
- Resources key the
ServletContext is stored under.
SERVLET_CONTEXT_KEY
public static java.lang.String SERVLET_CONTEXT_KEY
- Deprecated. This will be removed after Struts 1.2
- Resources key the
ServletContext is stored under.
HTTP_SERVLET_REQUEST_PARAM
private static java.lang.String HTTP_SERVLET_REQUEST_PARAM
- Resources key the
HttpServletRequest is stored under.
HTTP_SERVLET_REQUEST_KEY
public static java.lang.String HTTP_SERVLET_REQUEST_KEY
- Deprecated. This will be removed after Struts 1.2
- Resources key the
HttpServletRequest is stored under.
ACTION_MESSAGES_PARAM
private static java.lang.String ACTION_MESSAGES_PARAM
- Resources key the
ActionMessages is stored under.
ACTION_ERRORS_KEY
public static java.lang.String ACTION_ERRORS_KEY
- Deprecated. This will be removed after Struts 1.2
- Resources key the
ActionErrors is stored under.
Resources
public Resources()
getValidatorResources
public static org.apache.commons.validator.ValidatorResources getValidatorResources(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request)
- Retrieve
ValidatorResources for the current module.
getMessageResources
public static org.apache.struts.util.MessageResources getMessageResources(javax.servlet.http.HttpServletRequest request)
- Retrieve
MessageResources for the module.
getMessageResources
public static org.apache.struts.util.MessageResources getMessageResources(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
java.lang.String bundle)
- Retrieve
MessageResources for the module and bundle.
getLocale
public static java.util.Locale getLocale(javax.servlet.http.HttpServletRequest request)
- Deprecated. Use RequestUtils.getUserLocale() instead. This will be removed
after Struts 1.2.
- Get the
Locale of the current user.
getMessage
public static java.lang.String getMessage(org.apache.struts.util.MessageResources messages,
java.util.Locale locale,
java.lang.String key)
- Gets the
Locale sensitive value based on the key passed in.
getMessage
public static java.lang.String getMessage(javax.servlet.http.HttpServletRequest request,
java.lang.String key)
- Gets the
Locale sensitive value based on the key passed in.
getMessage
public static java.lang.String getMessage(org.apache.struts.util.MessageResources messages,
java.util.Locale locale,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
- Gets the locale sensitive message based on the
ValidatorAction message and the Field's
arg objects.
getMessage
public static java.lang.String getMessage(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
org.apache.struts.util.MessageResources defaultMessages,
java.util.Locale locale,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
- Gets the
Locale sensitive value based on the key passed in.
getActionError
public static org.apache.struts.action.ActionError getActionError(javax.servlet.http.HttpServletRequest request,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
- Deprecated. Use getActionMessage() instead. This will be removed after
Struts 1.2.
- Gets the
ActionError based on the
ValidatorAction message and the Field's
arg objects.
getActionMessage
public static org.apache.struts.action.ActionMessage getActionMessage(javax.servlet.http.HttpServletRequest request,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
- Gets the
ActionMessage based on the
ValidatorAction message and the Field's
arg objects.
getActionMessage
public static org.apache.struts.action.ActionMessage getActionMessage(org.apache.commons.validator.Validator validator,
javax.servlet.http.HttpServletRequest request,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
- Gets the
ActionMessage based on the
ValidatorAction message and the Field's
arg objects.
getArgs
public static java.lang.String[] getArgs(java.lang.String actionName,
org.apache.struts.util.MessageResources messages,
java.util.Locale locale,
org.apache.commons.validator.Field field)
- Gets the message arguments based on the current
ValidatorAction and Field.
getArgValues
private static java.lang.String[] getArgValues(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
org.apache.struts.util.MessageResources defaultMessages,
java.util.Locale locale,
org.apache.commons.validator.Arg[] args)
- Gets the message arguments based on the current
ValidatorAction and Field.
initValidator
public static org.apache.commons.validator.Validator initValidator(java.lang.String key,
java.lang.Object bean,
javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionMessages errors,
int page)
- Initialize the
Validator to perform validation.