public class Resources extends Object
Constructor and Description |
---|
Resources() |
Modifier and Type | Method and Description |
---|---|
static ActionMessage |
getActionMessage(javax.servlet.http.HttpServletRequest request,
org.apache.commons.validator.ValidatorAction va,
org.apache.commons.validator.Field field)
Deprecated.
Use getActionMessage(Validator, HttpServletRequest,
ValidatorAction, Field) method instead
|
static 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 String[] |
getArgs(String actionName,
MessageResources messages,
Locale locale,
org.apache.commons.validator.Field field)
Gets the message arguments based on the current
ValidatorAction
and Field . |
static String |
getMessage(javax.servlet.http.HttpServletRequest request,
String key)
Gets the
Locale sensitive value based on the key passed
in. |
static String |
getMessage(MessageResources messages,
Locale locale,
String key)
Gets the
Locale sensitive value based on the key passed
in. |
static String |
getMessage(MessageResources messages,
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 String |
getMessage(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
MessageResources defaultMessages,
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 MessageResources |
getMessageResources(javax.servlet.http.HttpServletRequest request)
Retrieve
MessageResources for the module. |
static MessageResources |
getMessageResources(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
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 String |
getVarValue(String varName,
org.apache.commons.validator.Field field,
org.apache.commons.validator.Validator validator,
javax.servlet.http.HttpServletRequest request,
boolean required)
Get the value of a variable.
|
static String |
getVarValue(org.apache.commons.validator.Var var,
javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
boolean required)
Get the value of a variable.
|
static org.apache.commons.validator.Validator |
initValidator(String key,
Object bean,
javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
ActionMessages errors,
int page)
Initialize the
Validator to perform validation. |
public static org.apache.commons.validator.ValidatorResources getValidatorResources(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request)
ValidatorResources
for the current module.application
- Application Contextrequest
- The ServletRequestpublic static MessageResources getMessageResources(javax.servlet.http.HttpServletRequest request)
MessageResources
for the module.request
- the servlet requestpublic static MessageResources getMessageResources(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, String bundle)
MessageResources
for the module and bundle.application
- the servlet contextrequest
- the servlet requestbundle
- the bundle keypublic static String getVarValue(String varName, org.apache.commons.validator.Field field, org.apache.commons.validator.Validator validator, javax.servlet.http.HttpServletRequest request, boolean required)
varName
- The variable namefield
- the validator Fieldvalidator
- The Validatorrequest
- the servlet requestrequired
- Whether the variable is mandatorypublic static String getVarValue(org.apache.commons.validator.Var var, javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, boolean required)
var
- the validator variableapplication
- The ServletContextrequest
- the servlet requestrequired
- Whether the variable is mandatorypublic static String getMessage(MessageResources messages, Locale locale, String key)
Locale
sensitive value based on the key passed
in.messages
- The Message resourceslocale
- The locale.key
- Key used to lookup the messagepublic static String getMessage(javax.servlet.http.HttpServletRequest request, String key)
Locale
sensitive value based on the key passed
in.request
- servlet requestkey
- the request keypublic static String getMessage(MessageResources messages, Locale locale, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field)
ValidatorAction
message and the Field
's arg objects.messages
- The Message resourceslocale
- The localeva
- The Validator Actionfield
- The Validator Fieldpublic static String getMessage(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, MessageResources defaultMessages, Locale locale, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field)
Locale
sensitive value based on the key passed
in.application
- the servlet contextrequest
- the servlet requestdefaultMessages
- The default Message resourceslocale
- The localeva
- The Validator Actionfield
- The Validator Fieldpublic static ActionMessage getActionMessage(javax.servlet.http.HttpServletRequest request, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field)
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
getActionMessage(Validator,HttpServletRequest,ValidatorAction,Field)
instead.
request
- the servlet requestva
- Validator actionfield
- the validator Fieldpublic static 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)
ActionMessage
based on the
ValidatorAction
message and the Field
's arg
objects.validator
- the Validatorrequest
- the servlet requestva
- Validator actionfield
- the validator Fieldpublic static String[] getArgs(String actionName, MessageResources messages, Locale locale, org.apache.commons.validator.Field field)
ValidatorAction
and Field
.actionName
- action namemessages
- message resourceslocale
- the localefield
- the validator fieldpublic static org.apache.commons.validator.Validator initValidator(String key, Object bean, javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, ActionMessages errors, int page)
Validator
to perform validation.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 a
Field can control the processing of
fields. If the field's page is less than or equal
to this page value, it will be processed.
Copyright © 2000–2017 Apache Software Foundation. All rights reserved.