struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: expression validator
Date Fri, 29 Feb 2008 15:06:01 GMT
--- mojoRising <jpiser@averoinc.com> wrote:
> Thanks. But I still don't understand...According to the link you mentioned
> it is not possible to do what I was trying to. So, what is the point of
this
> validator if it doesn't do client side validation? 

Because there are other places to do validation, like the server.

> And, are you saying that it is not possible to do a simple
> 'equals' test in client side validation? 
> 
>  <validator type="expression">password.equals(password2)
>     <message>Passwords do not match</message> 
>    </validator> 

The expressions used by the expression validator [1] are OGNL-based
expressions, not JavaScript. It would be *possible*, but JavaScript !=OGNL,
and it's my assumption that nobody wanted to write a JavaScript library that
implements everything available in OGNL.

That said, I suppose one could take a DWR-like Java => JavaScript mapping
layer then write OGNL in JavaScript and hook the two up. I don't know what
the current status of the XWork validation framework re-thinking is, but I'm
sure if something like that was contributed we'd look at it.

Dave

[1] http://struts.apache.org/2.x/docs/expression-validator.html



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


Mime
View raw message