Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.struts.validator.Resources
public class Resources
extends java.lang.Object
Field Summary | |
static String |
|
private static String |
|
static String |
|
private static String |
|
static String |
|
private static String |
|
Method Summary | |
static ActionError |
|
static ActionMessage |
|
static ActionMessage |
|
private static String[] |
|
static String[] |
|
static Locale |
|
static String |
|
static String |
|
static String |
|
static String |
|
static MessageResources |
|
static MessageResources |
|
static ValidatorResources |
|
static Validator |
|
public static String ACTION_ERRORS_KEY
Deprecated. This will be removed after Struts 1.2
Resources key theActionErrors
is stored under.
private static String ACTION_MESSAGES_PARAM
Resources key theActionMessages
is stored under.
public static String HTTP_SERVLET_REQUEST_KEY
Deprecated. This will be removed after Struts 1.2
Resources key theHttpServletRequest
is stored under.
private static String HTTP_SERVLET_REQUEST_PARAM
Resources key theHttpServletRequest
is stored under.
public static String SERVLET_CONTEXT_KEY
Deprecated. This will be removed after Struts 1.2
Resources key theServletContext
is stored under.
private static String SERVLET_CONTEXT_PARAM
Resources key theServletContext
is stored under.
public static ActionError getActionError(HttpServletRequest request, ValidatorAction va, Field field)
Deprecated. Use getActionMessage() instead. This will be removed after Struts 1.2.
Gets theActionError
based on theValidatorAction
message and theField
's arg objects.
- Parameters:
request
- the servlet requestva
- Validator actionfield
- the validator Field
public static ActionMessage getActionMessage(HttpServletRequest request, ValidatorAction va, Field field)
Gets theActionMessage
based on theValidatorAction
message and theField
's arg objects.
- Parameters:
request
- the servlet requestva
- Validator actionfield
- the validator Field
public static ActionMessage getActionMessage(Validator validator, HttpServletRequest request, ValidatorAction va, Field field)
Gets theActionMessage
based on theValidatorAction
message and theField
's arg objects.
- Parameters:
validator
- the Validatorrequest
- the servlet requestva
- Validator actionfield
- the validator Field
private static String[] getArgValues(ServletContext application, HttpServletRequest request, MessageResources defaultMessages, Locale locale, Arg[] args)
Gets the message arguments based on the currentValidatorAction
andField
.
- Parameters:
application
- the servlet contextrequest
- the servlet requestdefaultMessages
- Default message resourceslocale
- the localeargs
- The arguments for the message
public static String[] getArgs(String actionName, MessageResources messages, Locale locale, Field field)
Gets the message arguments based on the currentValidatorAction
andField
.
- Parameters:
actionName
- action namemessages
- message resourceslocale
- the localefield
- the validator field
public static Locale getLocale(HttpServletRequest request)
Deprecated. Use RequestUtils.getUserLocale() instead. This will be removed after Struts 1.2.
Get theLocale
of the current user.
- Parameters:
request
- servlet request
public static String getMessage(HttpServletRequest request, String key)
Gets theLocale
sensitive value based on the key passed in.
- Parameters:
request
- servlet requestkey
- the request key
public static String getMessage(ServletContext application, HttpServletRequest request, MessageResources defaultMessages, Locale locale, ValidatorAction va, Field field)
Gets theLocale
sensitive value based on the key passed in.
- Parameters:
application
- the servlet contextrequest
- the servlet requestdefaultMessages
- The default Message resourceslocale
- The localeva
- The Validator Actionfield
- The Validator Field
public static String getMessage(MessageResources messages, Locale locale, String key)
Gets theLocale
sensitive value based on the key passed in.
- Parameters:
messages
- The Message resourceslocale
- The locale.key
- Key used to lookup the message
public static String getMessage(MessageResources messages, Locale locale, ValidatorAction va, Field field)
Gets the locale sensitive message based on theValidatorAction
message and theField
's arg objects.
- Parameters:
messages
- The Message resourceslocale
- The localeva
- The Validator Actionfield
- The Validator Field
public static MessageResources getMessageResources(HttpServletRequest request)
RetrieveMessageResources
for the module.
- Parameters:
request
- the servlet request
public static MessageResources getMessageResources(ServletContext application, HttpServletRequest request, String bundle)
RetrieveMessageResources
for the module and bundle.
- Parameters:
application
- the servlet contextrequest
- the servlet requestbundle
- the bundle key
public static ValidatorResources getValidatorResources(ServletContext application, HttpServletRequest request)
RetrieveValidatorResources
for the current module.
- Parameters:
application
- Application Contextrequest
- The ServletRequest
public static Validator initValidator(String key, Object bean, ServletContext application, HttpServletRequest request, ActionMessages errors, int page)
Initialize theValidator
to perform validation.
- Parameters:
key
- The key that the validation rules are under (the form elements name attribute).bean
- The bean validation is being performed on.application
- servlet contextrequest
- The current request object.errors
- The object any errors will be stored in.page
- This in conjunction with the page property of aField
can control the processing of fields. If the field's page is less than or equal to this page value, it will be processed.