| java.lang.Object org.apache.struts.validator.Resources
Resources | public class Resources (Code) | | This class helps provides some useful methods for retrieving objects from
different scopes of the application.
version: $Rev: 476419 $ $Date: 2005-09-16 23:34:41 -0400 (Fri, 16 Sep 2005) version: $ since: Struts 1.1 |
Method Summary | |
public static ActionMessage | getActionMessage(HttpServletRequest request, ValidatorAction va, Field field) Gets the ActionMessage based on the
ValidatorAction message and the Field 's arg
objects.
Note: this method does not respect bundle information
stored with the field's <msg> or <arg> elements, and localization
will not work for alternative resource bundles. | public static ActionMessage | getActionMessage(Validator validator, HttpServletRequest request, ValidatorAction va, Field field) Gets the ActionMessage based on the
ValidatorAction message and the Field 's arg
objects. | public static String[] | getArgs(String actionName, MessageResources messages, Locale locale, Field field) Gets the message arguments based on the current ValidatorAction
and Field . | public static String | getMessage(MessageResources messages, Locale locale, String key) Gets the Locale sensitive value based on the key passed
in. | public static String | getMessage(HttpServletRequest request, String key) Gets the Locale sensitive value based on the key passed
in. | public static String | getMessage(MessageResources messages, Locale locale, ValidatorAction va, Field field) Gets the locale sensitive message based on the ValidatorAction
message and the Field 's arg objects. | public static String | getMessage(ServletContext application, HttpServletRequest request, MessageResources defaultMessages, Locale locale, ValidatorAction va, Field field) Gets the Locale sensitive value based on the key passed
in. | public static MessageResources | getMessageResources(HttpServletRequest request) Retrieve MessageResources for the module. | public static MessageResources | getMessageResources(ServletContext application, HttpServletRequest request, String bundle) Retrieve MessageResources for the module and bundle. | public static ValidatorResources | getValidatorResources(ServletContext application, HttpServletRequest request) Retrieve ValidatorResources for the current module. | public static String | getVarValue(String varName, Field field, Validator validator, HttpServletRequest request, boolean required) Get the value of a variable. | public static String | getVarValue(Var var, ServletContext application, HttpServletRequest request, boolean required) Get the value of a variable. | public static Validator | initValidator(String key, Object bean, ServletContext application, HttpServletRequest request, ActionMessages errors, int page) Initialize the Validator to perform validation.
Parameters: key - The key that the validation rules are under (theform elements name attribute). Parameters: bean - The bean validation is being performed on. Parameters: application - servlet context Parameters: request - The current request object. Parameters: errors - The object any errors will be stored in. Parameters: page - This in conjunction with the page property of aField can control the processing offields. |
getActionMessage | public static ActionMessage getActionMessage(HttpServletRequest request, ValidatorAction va, Field field)(Code) | | Gets the ActionMessage based on the
ValidatorAction message and the Field 's arg
objects.
Note: this method does not respect bundle information
stored with the field's <msg> or <arg> elements, and localization
will not work for alternative resource bundles. This method is
deprecated for this reason, and you should use
Resources.getActionMessage(Validator,HttpServletRequest,ValidatorAction,Field) instead.
Parameters: request - the servlet request Parameters: va - Validator action Parameters: field - the validator Field |
getActionMessage | public static ActionMessage getActionMessage(Validator validator, HttpServletRequest request, ValidatorAction va, Field field)(Code) | | Gets the ActionMessage based on the
ValidatorAction message and the Field 's arg
objects.
Parameters: validator - the Validator Parameters: request - the servlet request Parameters: va - Validator action Parameters: field - the validator Field |
getArgs | public static String[] getArgs(String actionName, MessageResources messages, Locale locale, Field field)(Code) | | Gets the message arguments based on the current ValidatorAction
and Field .
Parameters: actionName - action name Parameters: messages - message resources Parameters: locale - the locale Parameters: field - the validator field |
getMessage | public static String getMessage(MessageResources messages, Locale locale, String key)(Code) | | Gets the Locale sensitive value based on the key passed
in.
Parameters: messages - The Message resources Parameters: locale - The locale. Parameters: key - Key used to lookup the message |
getMessage | public static String getMessage(HttpServletRequest request, String key)(Code) | | Gets the Locale sensitive value based on the key passed
in.
Parameters: request - servlet request Parameters: key - the request key |
getMessage | public static String getMessage(MessageResources messages, Locale locale, ValidatorAction va, Field field)(Code) | | Gets the locale sensitive message based on the ValidatorAction
message and the Field 's arg objects.
Parameters: messages - The Message resources Parameters: locale - The locale Parameters: va - The Validator Action Parameters: field - The Validator Field |
getMessage | public static String getMessage(ServletContext application, HttpServletRequest request, MessageResources defaultMessages, Locale locale, ValidatorAction va, Field field)(Code) | | Gets the Locale sensitive value based on the key passed
in.
Parameters: application - the servlet context Parameters: request - the servlet request Parameters: defaultMessages - The default Message resources Parameters: locale - The locale Parameters: va - The Validator Action Parameters: field - The Validator Field |
getMessageResources | public static MessageResources getMessageResources(ServletContext application, HttpServletRequest request, String bundle)(Code) | | Retrieve MessageResources for the module and bundle.
Parameters: application - the servlet context Parameters: request - the servlet request Parameters: bundle - the bundle key |
getValidatorResources | public static ValidatorResources getValidatorResources(ServletContext application, HttpServletRequest request)(Code) | | Retrieve ValidatorResources for the current module.
Parameters: application - Application Context Parameters: request - The ServletRequest |
getVarValue | public static String getVarValue(String varName, Field field, Validator validator, HttpServletRequest request, boolean required)(Code) | | Get the value of a variable.
Parameters: varName - The variable name Parameters: field - the validator Field Parameters: validator - The Validator Parameters: request - the servlet request Parameters: required - Whether the variable is mandatory The variable's value |
getVarValue | public static String getVarValue(Var var, ServletContext application, HttpServletRequest request, boolean required)(Code) | | Get the value of a variable.
Parameters: var - the validator variable Parameters: application - The ServletContext Parameters: request - the servlet request Parameters: required - Whether the variable is mandatory The variables values |
initValidator | public static Validator initValidator(String key, Object bean, ServletContext application, HttpServletRequest request, ActionMessages errors, int page)(Code) | | Initialize the Validator to perform validation.
Parameters: key - The key that the validation rules are under (theform elements name attribute). Parameters: bean - The bean validation is being performed on. Parameters: application - servlet context Parameters: request - The current request object. Parameters: errors - The object any errors will be stored in. Parameters: page - This in conjunction with the page property of aField can control the processing offields. If the field's page is less than or equalto this page value, it will be processed. |
|
|