Hallo,
ich habe folgende Action (in Auszügen):
Ich bekomme immer bei der Ausführung der Annotation:
Folgende Exception:
Irgendetwas stimmt mit dem Ausdruck in expression nicht. Ich weiss nicht was. Hat jemand von Euch eine Idee?
Viele Grüße und Danke
Ulrich
ich habe folgende Action (in Auszügen):
Code:
package action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
import com.opensymphony.xwork2.validator.annotations.ConversionErrorFieldValidator;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.ExpressionValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import com.opensymphony.xwork2.validator.annotations.Validation;
@Validation
public class RegistrierungSpeichernAction extends ActionSupport {
private String passwort;
private String passwortKontrolle;
@RequiredStringValidator(message = "${getText('register.errorNoPassword')}")
@StringLengthFieldValidator(minLength = "8", message = "${getText('register.errorPasswordToShort')}")
public String getPasswort() {
return passwort;
}
public void setPasswort(String passwort) {
this.passwort = passwort;
}
@ExpressionValidator(expression = "passwortkontrolle == passwort", message = "${getText('register.errorPassword')}")
public String getPasswortKontrolle() {
return passwortKontrolle;
}
public void setPasswortKontrolle(String passwortKontrolle) {
this.passwortKontrolle = passwortKontrolle;
}
public String execute() throws SQLException {
....
return SUCCESS;
}
}
Ich bekomme immer bei der Ausführung der Annotation:
Code:
@ExpressionValidator(expression = "passwortkontrolle == passwort", message = "${getText('register.errorPassword')}")
Code:
Caught OgnlException while setting property 'fieldName' on type 'com.opensymphony.xwork2.validator.validators.ExpressionValidator'.
ognl.NoSuchPropertyException: com.opensymphony.xwork2.validator.validators.ExpressionValidator.fieldName
at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
at com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:103)
at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:90)
at com.opensymphony.xwork2.ObjectFactory.buildValidator(ObjectFactory.java:251)
at com.opensymphony.xwork2.validator.ValidatorFactory.getValidator(ValidatorFactory.java:256)
.....
Irgendetwas stimmt mit dem Ausdruck in expression nicht. Ich weiss nicht was. Hat jemand von Euch eine Idee?
Viele Grüße und Danke
Ulrich