|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.ActionForm org.apache.struts.validator.ValidatorForm
public class ValidatorForm
This class extends ActionForm and provides basic field validation based on an XML file. The key passed into the validator is the action element's 'name' attribute from the struts-config.xml which should match the form element's name attribute in the validation.xml.
ValidatorPlugin
definition in struts-config.xml for
validation rules.
ActionForm
,
Serialized FormField Summary | |
---|---|
protected int |
page
Used to indicate the current page of a multi-page form. |
protected ValidatorResults |
validatorResults
The results returned from the validation performed by the Validator . |
Fields inherited from class org.apache.struts.action.ActionForm |
---|
multipartRequestHandler, servlet |
Constructor Summary | |
---|---|
ValidatorForm()
|
Method Summary | |
---|---|
int |
getPage()
Gets page. |
Map |
getResultValueMap()
Returns a Map of values returned from any validation that
returns a value other than null or Boolean
with the key the full property path of the field. |
String |
getValidationKey(ActionMapping mapping,
HttpServletRequest request)
Returns the Validation key. |
ValidatorResults |
getValidatorResults()
Get results of the validation performed by the Validator . |
void |
reset(ActionMapping mapping,
HttpServletRequest request)
Reset all properties to their default values. |
void |
setPage(int page)
Sets page. |
void |
setValidatorResults(ValidatorResults validatorResults)
Set results of the validation performed by the Validator . |
ActionErrors |
validate(ActionMapping mapping,
HttpServletRequest request)
Validate the properties that have been set from this HTTP request, and return an ActionErrors object that encapsulates any
validation errors that have been found. |
Methods inherited from class org.apache.struts.action.ActionForm |
---|
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ValidatorResults validatorResults
Validator
.
protected int page
Constructor Detail |
---|
public ValidatorForm()
Method Detail |
---|
public int getPage()
public void setPage(int page)
page
- page numberpublic ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
ActionErrors
object that encapsulates any
validation errors that have been found. If no errors are found, return
null
or an ActionErrors
object with no
recorded error messages.
validate
in class ActionForm
mapping
- The mapping used to select this instancerequest
- The servlet request we are processing
ActionErrors
object that encapsulates any
validation errorsDynaActionForm
public String getValidationKey(ActionMapping mapping, HttpServletRequest request)
mapping
- The mapping used to select this instancerequest
- The servlet request we are processing
public void reset(ActionMapping mapping, HttpServletRequest request)
reset
in class ActionForm
mapping
- The mapping used to select this instancerequest
- The servlet request we are processingpublic ValidatorResults getValidatorResults()
Validator
.
public void setValidatorResults(ValidatorResults validatorResults)
Validator
.
validatorResults
- results of validationpublic Map getResultValueMap()
Map
of values returned from any validation that
returns a value other than null
or Boolean
with the key the full property path of the field.
Map
of non-null values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |