org.apache.struts.chain.commands.servlet
public class: ValidateActionForm [javadoc |
source]
java.lang.Object
org.apache.struts.chain.commands.ActionCommandBase
org.apache.struts.chain.commands.AbstractValidateActionForm
org.apache.struts.chain.commands.servlet.ValidateActionForm
All Implemented Interfaces:
ActionCommand
Validate the properties of the form bean for this request. If there are
any validation errors, execute the child commands in our chain; otherwise,
proceed normally. Also, if any errors are found and the request is a
multipart request, rollback the MultipartRequestHandler.
- version:
$ - Rev: 471754 $ $Date: 2005-06-04 10:58:46 -0400 (Sat, 04 Jun 2005)
$
| Method from org.apache.struts.chain.commands.servlet.ValidateActionForm Summary: |
|---|
|
validate |
| Methods from org.apache.struts.chain.commands.AbstractValidateActionForm: |
|---|
|
execute, validate |
| Methods from org.apache.struts.chain.commands.ActionCommandBase: |
|---|
|
execute, execute |
| Method from org.apache.struts.chain.commands.servlet.ValidateActionForm Detail: |
protected ActionErrors validate(ActionContext context,
ActionConfig actionConfig,
ActionForm actionForm) {
// ------------------------------------------------------- Protected Methods
ServletActionContext saContext = (ServletActionContext) context;
ActionErrors errors =
(actionForm.validate((ActionMapping) actionConfig,
saContext.getRequest()));
// Special handling for multipart request
if ((errors != null) && !errors.isEmpty()) {
if (actionForm.getMultipartRequestHandler() != null) {
if (log.isTraceEnabled()) {
log.trace(" Rolling back multipart request");
}
actionForm.getMultipartRequestHandler().rollback();
}
}
return errors;
}
Call the validate() method of the specified form bean,
and return the resulting ActionErrors object.
|