|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.struts.validator.Resources
This class helps provides some useful methods for retrieving objects from different scopes of the application.
Field Summary | |
static java.lang.String |
ACTION_ERRORS_KEY
Deprecated. This will be removed after Struts 1.2 |
private static java.lang.String |
ACTION_MESSAGES_PARAM
Resources key the ActionMessages is stored under. |
static java.lang.String |
HTTP_SERVLET_REQUEST_KEY
Deprecated. This will be removed after Struts 1.2 |
private static java.lang.String |
HTTP_SERVLET_REQUEST_PARAM
Resources key the HttpServletRequest is stored under. |
static java.lang.String |
SERVLET_CONTEXT_KEY
Deprecated. This will be removed after Struts 1.2 |
private static java.lang.String |
SERVLET_CONTEXT_PARAM
Resources key the ServletContext is stored under. |
Constructor Summary | |
Resources()
|
Method Summary | |
static 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 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 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,
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,
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(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(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,
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 MessageResources |
getMessageResources(javax.servlet.http.HttpServletRequest request)
Retrieve MessageResources for the module. |
static 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,
ActionMessages errors,
int page)
Initialize the Validator to perform validation. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static java.lang.String SERVLET_CONTEXT_PARAM
ServletContext
is stored under.public static java.lang.String SERVLET_CONTEXT_KEY
ServletContext
is stored under.private static java.lang.String HTTP_SERVLET_REQUEST_PARAM
HttpServletRequest
is stored under.public static java.lang.String HTTP_SERVLET_REQUEST_KEY
HttpServletRequest
is stored under.private static java.lang.String ACTION_MESSAGES_PARAM
ActionMessages
is stored under.public static java.lang.String ACTION_ERRORS_KEY
ActionErrors
is stored under.Constructor Detail |
public Resources()
Method Detail |
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, java.lang.String bundle)
MessageResources
for the module and bundle.application
- the servlet contextrequest
- the servlet requestbundle
- the bundle keypublic static java.util.Locale getLocale(javax.servlet.http.HttpServletRequest request)
Locale
of the current user.request
- servlet requestpublic static java.lang.String getMessage(MessageResources messages, java.util.Locale locale, java.lang.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 java.lang.String getMessage(javax.servlet.http.HttpServletRequest request, java.lang.String key)
Locale
sensitive value based on the key passed in.request
- servlet requestkey
- the request keypublic static java.lang.String getMessage(MessageResources messages, java.util.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 java.lang.String getMessage(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, MessageResources defaultMessages, java.util.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 ActionError getActionError(javax.servlet.http.HttpServletRequest request, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field)
ActionError
based on the
ValidatorAction
message and the Field
's
arg objects.request
- the servlet requestva
- 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.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 java.lang.String[] getArgs(java.lang.String actionName, MessageResources messages, java.util.Locale locale, org.apache.commons.validator.Field field)
ValidatorAction
and Field
.actionName
- action namemessages
- message resourceslocale
- the localefield
- the validator fieldprivate static java.lang.String[] getArgValues(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, MessageResources defaultMessages, java.util.Locale locale, org.apache.commons.validator.Arg[] args)
ValidatorAction
and Field
.application
- the servlet contextrequest
- the servlet requestdefaultMessages
- Default message resourceslocale
- the localeargs
- The arguments for the messagepublic static org.apache.commons.validator.Validator initValidator(java.lang.String key, java.lang.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |