i can get length now using title.length(), but my EL tests don't seem to work.

if i use this:
  <param name="expression">title.length()</param>

i get a message saying 'Got result of N when trying to get boolean' where N is the length.

however, if I use a simple OGNL expression:
  <param name="expression">title.length() == 10</param>

i get nothing. no error, no output, regardless of what input i pass.





Mike Cannon-Brookes wrote:
Try title.length() &gt; 10

The expression validator is a little confusing at the moment, if the
expression is FALSE, it is invalid.

Cheers,
Mike

On 9/6/03 1:15 PM, "Toby Hede" ([EMAIL PROTECTED]) penned the
words:


i tried escaping the <, but still get no validation on length - am i
accessing the method correctly?


Mike Cannon-Brookes wrote:


Toby,

Because it's XML, you need to escape the < - ie &lt;

Cheers,
Mike

On 9/6/03 12:03 PM, "Toby Hede" ([EMAIL PROTECTED]) penned the
words:



hi there again, i am attempting to validate string length using XWork
validation.

i solved the problem using a custom validator, which i have attached in
case anyone finds it useful ... feel free to roll it into xwork.

then i suddenly realised that i could possibly use the expression
validator to test string length without having a custom class. so i
wrote the following, but it doesn't parse because of the '<' character
(this possibly means that the example on the wiki is also broken).
wrapping in a CDATA element gives an error stating 'Got result of null
when trying to get boolean'.

<validator type="expression">
 <param name="expression">title.length < 10</param>
 <message>Title must be less than 10 characters long.</message>
</validator>

CDATA:
<![CDATA[title.length < 10]]>

is using the expression validation not possible when validating string
length?



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork





-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork





-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to