org.apache.struts.util
Class StrutsValidatorUtil

java.lang.Object
  |
  +--org.apache.struts.util.StrutsValidatorUtil

Deprecated. As of Struts 1.1, replaced by Resources

public class StrutsValidatorUtil
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:
$Revision: 1.1 $ $Date$
Author:
David Winterfeldt, Eddie Bush

Field Summary
static java.lang.String ACTION_ERRORS_KEY
          Deprecated. Resources key the ActionErrors is stored under.
static java.lang.String HTTP_SERVLET_REQUEST_KEY
          Deprecated. Resources key the HttpServletRequest is stored under.
static java.lang.String SERVLET_CONTEXT_KEY
          Deprecated. Resources key the ServletContext is stored under.
 
Constructor Summary
StrutsValidatorUtil()
          Deprecated.  
 
Method Summary
static ActionError getActionError(javax.servlet.http.HttpServletRequest request, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field)
          Deprecated. As of Struts 1.1, replaced by Resources.getActionError(HttpServletRequest, ValidatorAction, Field)
static java.lang.String[] getArgs(java.lang.String actionName, MessageResources messages, java.util.Locale locale, org.apache.commons.validator.Field field)
          Deprecated. As of Struts 1.1, replaced by Resources.getArgs(String,MessageResources,Locale,Field)
static java.util.Locale getLocale(javax.servlet.http.HttpServletRequest request)
          Deprecated. Get the Locale of the current user.
static java.lang.String getMessage(javax.servlet.http.HttpServletRequest request, java.lang.String key)
          Deprecated. 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)
          Deprecated. 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)
          Deprecated. As of Struts 1.1, replaced by Resources.getMessage(MessageResources, Locale, ValidatorAction , Field)
static MessageResources getMessageResources(javax.servlet.http.HttpServletRequest request)
          Deprecated. Retrieve MessageResources for the application module.
static MessageResources getMessageResources(javax.servlet.ServletContext application)
          Deprecated. This method can only return the resources for the default module. Use getMessageResources(HttpServletRequest) to get the resources for the current application module.
static org.apache.commons.validator.ValidatorResources getValidatorResources(javax.servlet.ServletContext application)
          Deprecated. In Struts 1.1 This method can only return the resources for the default module. Use getValidatorResources(HttpServletRequest, ServletContext) to get the resources for the current application module.
static org.apache.commons.validator.ValidatorResources getValidatorResources(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request)
          Deprecated. 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, ActionErrors errors, int page)
          Deprecated. As of Struts 1.1, replaced by Resources.initValidator(String,Object,ServletContext,HttpServletRequest,ActionErrors,int)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVLET_CONTEXT_KEY

public static java.lang.String SERVLET_CONTEXT_KEY
Deprecated. 
Resources key the ServletContext is stored under.


HTTP_SERVLET_REQUEST_KEY

public static java.lang.String HTTP_SERVLET_REQUEST_KEY
Deprecated. 
Resources key the HttpServletRequest is stored under.


ACTION_ERRORS_KEY

public static java.lang.String ACTION_ERRORS_KEY
Deprecated. 
Resources key the ActionErrors is stored under.

Constructor Detail

StrutsValidatorUtil

public StrutsValidatorUtil()
Deprecated. 
Method Detail

getValidatorResources

public static org.apache.commons.validator.ValidatorResources getValidatorResources(javax.servlet.ServletContext application)
Deprecated. In Struts 1.1 This method can only return the resources for the default module. Use getValidatorResources(HttpServletRequest, ServletContext) to get the resources for the current application module.

Retrieve ValidatorResources for the module.


getValidatorResources

public static org.apache.commons.validator.ValidatorResources getValidatorResources(javax.servlet.ServletContext application,
                                                                                    javax.servlet.http.HttpServletRequest request)
Deprecated. 
Retrieve ValidatorResources for the current module.


getMessageResources

public static MessageResources getMessageResources(javax.servlet.ServletContext application)
Deprecated. This method can only return the resources for the default module. Use getMessageResources(HttpServletRequest) to get the resources for the current application module.

Retrieve MessageResources for the application module.


getMessageResources

public static MessageResources getMessageResources(javax.servlet.http.HttpServletRequest request)
Deprecated. 
Retrieve MessageResources for the application module.


getLocale

public static java.util.Locale getLocale(javax.servlet.http.HttpServletRequest request)
Deprecated. 
Get the Locale of the current user.


getMessage

public static java.lang.String getMessage(MessageResources messages,
                                          java.util.Locale locale,
                                          java.lang.String key)
Deprecated. 
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)
Deprecated. 
Gets the Locale sensitive value based on the key passed in.


getMessage

public static java.lang.String getMessage(MessageResources messages,
                                          java.util.Locale locale,
                                          org.apache.commons.validator.ValidatorAction va,
                                          org.apache.commons.validator.Field field)
Deprecated. As of Struts 1.1, replaced by Resources.getMessage(MessageResources, Locale, ValidatorAction , Field)

Gets the locale sensitive message based on the ValidatorAction message and the Field's arg objects.


getActionError

public static ActionError getActionError(javax.servlet.http.HttpServletRequest request,
                                         org.apache.commons.validator.ValidatorAction va,
                                         org.apache.commons.validator.Field field)
Deprecated. As of Struts 1.1, replaced by Resources.getActionError(HttpServletRequest, ValidatorAction, Field)

Gets the ActionError based on the ValidatorAction message and the Field's arg objects.


getArgs

public static java.lang.String[] getArgs(java.lang.String actionName,
                                         MessageResources messages,
                                         java.util.Locale locale,
                                         org.apache.commons.validator.Field field)
Deprecated. As of Struts 1.1, replaced by Resources.getArgs(String,MessageResources,Locale,Field)

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,
                                                                   ActionErrors errors,
                                                                   int page)
Deprecated. As of Struts 1.1, replaced by Resources.initValidator(String,Object,ServletContext,HttpServletRequest,ActionErrors,int)

Initialize the Validator to perform validation.

Parameters:
key - The key that the validation rules are under (the form elements name attribute).
request - The current request object.
errors - The object any errors will be stored in.


Copyright © 2000-2003 - Apache Software Foundation