using groovy with stripes web framework

512 views Asked by At

I'll be joining a Java project that uses the Stripes web framework. Personally, I much prefer writing Groovy than Java, and am looking for opportunities to use Groovy in this project.

I'm looking for examples of where you can use Groovy (instead of Java) in a Stripes project presumably. Are there any particular steps that need to be taken in order to get Groovy working with Stripes (e.g. modifying the build)?

I'm particularly interested to know if it's possible to use GORM and GSP in a Stripes application.

Thanks, Don

2

There are 2 answers

1
lucas On

There aren't any specific steps, apart from modifying your build process to include the groovy libs at compile and runtime. We've integrated groovy into some of our new stripes applications, and I've only noticed a few gotchas:

  1. @URLBinding("/foo/{$bar}") needs to use single quotes, otherwise groovy tries to interpret as a gstring.
  2. While the linked article states you can take off getters and setters, I haven't had any luck. I just tried again and confirmed it doesn't work for me. I always assumed Stripes was using reflection to find the get* set* methods or something.
    Edit: I should mention, I mean on an action bean and using the variables through stripes:form or stripes:useActionBean
0
JB Nizet On

There is an article explaining how to use Groovy with Stripes here : http://www.fdaoud.com/groovy.html