struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hrvoje Ban" <kyro...@gmail.com>
Subject @FieldExpressionValidator calling action's method
Date Sat, 02 Aug 2008 18:51:14 GMT
I placed validation code for one of my fields inside action's method
and I'm trying to call it using OGNL expression:

@Validation
public class RegistrationAction extends ActionSupport {
	
	private String username;
	
	public boolean isUsernameAvailable() {
		// ...
	}
	
	@RequiredStringValidator(shortCircuit = true, trim = true, message = "...")
	@FieldExpressionValidator(expression = "isUsernameAvailable()",
message = "...")
	public String getUsername() {
		return username;
	}
}

Instead, when isUsernameAvailable() is supposed to be called I get
this warning in Tomcat console:
"Got result of null when trying to get Boolean."

Why, and how can I fix it?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message