@SkipValidation does not block the execution of validate()
----------------------------------------------------------
Key: WW-2390
URL: https://issues.apache.org/struts/browse/WW-2390
Project: Struts 2
Issue Type: Bug
Components: Core Interceptors
Affects Versions: 2.0.11
Environment: Windows Vista; JBoss 4.0.5.GA
Reporter: Christian Bonami
My action has got a method with @SkipValidation on prepareCreate(). It has also
a validate() method which shouldn't be called when prepareCreate() is called.
public class CustomerContractDetailS2Action extends ActionSupport implements
ModelDriven<CustomerContractModel>, Preparable,
ServletRequestAware {
...
@SkipValidation
public String prepareCreate() throws Exception {
this.model.setNscId(this.user.getNscId());
// model must be on top of stack
getValueStack().push(this.model);
return SUCCESS;
}
@Override
public void validate() {
if (new DateTime(this.model.getValidFrom()).compareTo(new
DateTime(
this.model.getValidTo())) >= 0) {
addActionError(getText("error.startDateBeforeEndDate"));
}
super.validate();
}
Nevertheless, validate() is automatically called on my action although this
shouldn't be the case.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.