You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2008/03/14 20:20:03 UTC
Re: Struts2 - Validating several fields depending on values of other
fields
Dirk Schumacher wrote:
> I know it would be solveable by the @FieldExpressionValidator where its
> expression can be filled with a complex OGNL-Expression.
> But if evaluating the expression internally throws an Exception, the
> evaluation does not terminate right. (I'd be fine with a negative
> validation
> and re-jecting to the input page, but if the OGNL is not evaluateable it
> passes the validation)
The expression shouldn't be so complicated; you're just comparing two
dates, after all. And why would the OGNL expression throw an exception?
The only issue I would expect is with one or both dates being null,
which you can avoid using a 'required' validator.
I would think working through any issues with this approach would be a
lot less pain than going for a custom validator in this case.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org