Well, after shamefully waiting over a year to do any kind of updates to this plugin, I've finally made some changes and merged in pull requests from others. Next steps are going to be fix some of the issues. Some great suggestions have come up in the Issues area on Github. In fact, I plan …
Category: Grails
XSS Sanitizer Grails Plugin
Well, earlier this week I published my first Grails plugin. I'm hoping that people will find it useful to add a general security plugin to parse out, and prevent XSS attacks on their website. It's a long way from being done, but I think it's a good start. It uses OWASP's ESAPI to strip out …
How to inject two or more dependencies with the same name
Let's say you have two services named UserService and both are included in your Grails classpath. This can happen, for example if you have a "core" package, and an "application" package that extends services from "core". Here's what that might look like in our case: Well, if you try to use "UserService" in your Grails …
Continue reading How to inject two or more dependencies with the same name
How to pass the entire model to a template in Grails
One way to pass the model set in your view GSP is to use ${pageScope.variables}. Here's an example:
Grails resources plugin
I installed the Grails zipped-resources plugin on a new project the other day, and I noticed that by default it zips up everything it sends. This is fine, but when I tried to make it ignore the image files being served up, it wasn't obvious at first how to do that. Finally, I figured out …
Grails CamelCase Sensitivity
I ran into an weird bug today that took awhile to figure out. Basically, I was getting the error when I deployed some grails code to a linux box. In the error log, this is what showed up: And, in the HTML response, this is what showed up: It took a while, but I finally …
How to setup a clustered Quartz scheduler in Grails 2.0.0
In my steps below, I'm using Grails 2.0.0 and Quartz 2.1.1. I'm also connecting to a local DB2 database. 1. Run "grails clean" on your application. 2. Add the "quartz-all-2.1.1.jar" and "c3p0-0.9.1.1.jar" (in the lib folder of your Quartz download) to your lib directory. 3. Right click on your Grails project and chose "Grails Tools …
Continue reading How to setup a clustered Quartz scheduler in Grails 2.0.0
Grails 2.0.0 lib directory fix
I recently had a problem with Grails when I started a new project in Eclipse with Grails 2.0.0. I tried adding an external JAR file to my "lib" directory by dragging the JAR file over to the directory. In Grails 1.3.7, the JAR file would then get added to the list of grails dependences (after …