|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ValidatedForm
class is used to validate http form data. It works
in conjunction with the ValidatedValues
object and plugable Validators
This class is designed to help by providing additional functionality in retrieving and validating
HTML Form
data. This class is designed to be called from an
InputProcessors
and work in conjunction with the
webflow:validatedForm
JSP tags.
Fields are retrieved from the HtttpServletRequest and
objects are validated per method call. Messages
are bits of
information displayed back on the browser screen indicating what is wrong with the field.
Example
Email addresses must be in name@domain format
It is the intent that messages will be pulled from a weblogic message catalog to support internationalization and customization, unless supplied per method call.
Fields inherited from class com.bea.p13n.appflow.webflow.forms.ValidatedFormConstants |
EMAIL_VALIDATOR,
NUMBER_VALIDATOR,
PHONE_VALIDATOR,
REGEXP_VALIDATOR,
SPECIAL_CHARACTER_VALIDATOR,
STRING_VALIDATOR |
Method Summary | |
void |
addValidator(java.lang.String ValidatorClassName)
Add Custom Validator to the pool of validators. |
void |
validate(ValidatedValues validatedValues,
java.lang.Object bean)
For each HttpRequest parameter try and call a setter on the bean. |
java.lang.String |
validate(ValidatedValues validatedValues,
java.lang.String RequestParam)
Retrieve an HttpServletRequest parameter and place the results into the ValidatedValues object to be retrieved by the webflow validated tags. |
java.lang.String |
validate(ValidatedValues validatedValues,
java.lang.String validatorClassName,
java.lang.String requestParam,
java.lang.Object expression)
Validate an HttpServletRequest parameter using the supplied validator and place the results into the ValidatedValues object to be retrieved by the webflow validated tags. |
java.lang.String |
validate(ValidatedValues validatedValues,
java.lang.String validatorClassName,
java.lang.String requestParam,
java.lang.Object expression,
java.lang.String message)
Validate an HttpServletRequest parameter using the supplied validator and place the results into the ValidatedValues object to be retrieved by the webflow validated tags. |
void |
validate(ValidatedValues validatedValues,
Validatable validatableBean)
For each HttpRequest parameter try and call a setter on the bean. |
java.util.Collection |
validateMultiple(ValidatedValues validatedValues,
java.lang.String requestParam)
Retrieve an Collection of HttpServletRequest parameters and place the results into the ValidatedValues object to be retrieved by the webflow validated tags. |
java.util.Collection |
validateMultiple(ValidatedValues validatedValues,
java.lang.String paramName,
int minimum)
Retrieve an Collection of HttpServletRequest parameters and place the results into the ValidatedValues object to be retrieved by the webflow validated tags. |
java.util.Collection |
validateMultiple(ValidatedValues validatedValues,
java.lang.String paramName,
int minimum,
java.lang.String message)
Retrieve an Collection of HttpServletRequest parameters and place the results into the ValidatedValues object to be retrieved by the webflow validated tags. |
Method Detail |
public java.lang.String validate(ValidatedValues validatedValues, java.lang.String validatorClassName, java.lang.String requestParam, java.lang.Object expression) throws MissingFormFieldException
ValidationException.xml
validateValues
- validatedValues object.validatorClassName
- the class name of the validator.RequestParam
- the HttpServletRequest parameter.expression
- optional expression object for the validator if the
validator does not use and expression object you may pass null.requestParam
is not
in the request.public java.lang.String validate(ValidatedValues validatedValues, java.lang.String validatorClassName, java.lang.String requestParam, java.lang.Object expression, java.lang.String message) throws MissingFormFieldException
validateValues
- validatedValues object.validatorClassName
- the class name of the validator.RequestParam
- the HttpServletRequest parameter.expression
- optional expression object for the validator if the
validator does not use and expression object you may pass null.message
- a error message to be supplied instead of retrieving
one from the internationalized message catalog.requestParam
is not
in the request.public java.lang.String validate(ValidatedValues validatedValues, java.lang.String RequestParam)
validateValues
- validatedValues object.RequestParam
- the HttpServletRequest parameter.public java.util.Collection validateMultiple(ValidatedValues validatedValues, java.lang.String paramName, int minimum) throws MissingFormFieldException
minimum
number of items are not selected
the validation will not pass and the user will be presented with
a internationalized message from the message catalog ValidationException.xml
validateValues
- validatedValues object.paramName
- the HttpServletRequest parameter.minimum
- the minimum number of items the user must select to
pass validation.requestParam
is not
in the HttpRequest.public java.util.Collection validateMultiple(ValidatedValues validatedValues, java.lang.String paramName, int minimum, java.lang.String message) throws MissingFormFieldException
minimum
number of items are not selected
the validation will not pass and the user will be presented with the supplied message
validateValues
- validatedValues object.paramName
- the HttpServletRequest parameter.minimum
- the minimum number of items the user must select tomessage
- a error message to be supplied instead of retrieving
one from the internationalized message catalog.requestParam
is not
in the HttpRequest.public java.util.Collection validateMultiple(ValidatedValues validatedValues, java.lang.String requestParam)
requestParam
is not in the
HttpRequest you will be returned a non null empty ArrayList.
validateValues
- validatedValues object.requestParam
- the HttpServletRequest parameter.public void validate(ValidatedValues validatedValues, java.lang.Object bean)
set method for each parameter.
- Parameters:
validateValues
- validatedValues object.bean
- java bean.
public void validate(ValidatedValues validatedValues, Validatable validatableBean)
set method for each parameter. The bean
must also implement Validatable
. After all the setters have bean called
the ValidatedForms class will call validate
method on the Validatable bean. It is
the job of the bean to validate all fields and update the status and message in the
ValidatedValues object. The ValidatedForms class will then handle updating the invalid field count.
- Parameters:
validateValues
- validatedValues object.validatableBean
- a java bean that implements Validatable
public void addValidator(java.lang.String ValidatorClassName)
Validator
- class name of the validator class
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |