Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Adding Groovy as CEL to spring modules validatio Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding Groovy as CEL to spring modules validatio

    Hey all,

    As a work I did for our application, I added support for groovy expression (as addition to the Valang and Ognl built in ones).

    Some notes:
    1. The expressions use value as the name of the object validated (e.g. value.foo > 10).
    2. Functions can be defined in an external file and are parsed once (no need to implement FEL interfaces for that)
    3. The functions file should reside in the classpath
    4. There is no performance penalty for using Groovy since the expressions are only evaluated only once (upon creation) and than are called as functions. Some performance test I did showed no difference in times using Groovy expressions or regular validation annotations (I did not compare it to valang or ognl).
    5. groovy-all.jar needs to be added to classpath

    It would be great if this could be added to the framework since groovy is gaining popularity (e.g grails) and IMHO more natural language to perform validation with.

    Tal Giat
Working...
X