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 …
Category: Technology
Click event slow in Chrome and Safari
Well, I came across an interesting quirk. Click events in Chrome and Safari were taking a couple of seconds before they were being fired. It was quite the head scratcher. Here's essentially what I was doing: At first, I just changed the <a> tag to be a <span> tag, and that worked. But, I couldn't …
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 …
Safari Not Working, But Firefox Does
I recently had a problem on my Macbook where Safari would stop working after a few minutes of connecting to the network, but other network applications, like Firefox, still worked. It was odd. Safari would just sit and hang. After some research, what ended up working for me was to create a new network profile. …
Selecting Popup Windows in Selenium
This example shows how to start a Selenium Server and run a Selenium client in Java. The example opens up a popup window by clicking on the link in index.html. It then selects the popup window by first using the "name=popupWindowName" option for selectWindow. It then grabs the original window (using "name=null"). And, finally, it …
Fixed: OpenOffice “Restore Windows” Popup
I tried starting Open Office on my Mac running 10.7.2, and I got this annoying popup window that won't go away. I click on "Don't Restore Windows" or "Restore Windows", and it just stays popped up. I found a solution though. 1) Force Quit your Open Office Application (Right-click holding the option key). 2) Open …
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