Archive for the ‘grails’ Category

Your Grails domain class has more properties than you think!

Tuesday, June 10th, 2008

But you probably already knew that - things like 'id', 'version' and 'log' properties are added to every Grails domain class by the framework and are pretty obvious.  But there are a few more that might not be so familiar. Take a look at this domain class: class Book { ...

The elusive HTML ‘id’ attribute when using <g:form>

Monday, April 14th, 2008

In most Grails tags, the usual HTML attributes get passed through to the output HTML, for example the 'class' attribute below: results in: I tried to do this with a g:form tag and passed in an "id" attribute so I could reference the form in javascript. But you can't pass an ...

Using the showSource parameter trick with rendered templates

Monday, March 31st, 2008

This is a follow-up to my previous post about using the showSource parameter in Grails. If you're using templates to keep DRY, you may need to pay attention to the details of the stack trace that show which GSP contains the error. For instance, say my show.gsp renders a template ...

Viewing the source of a compiled GSP in Grails

Saturday, March 15th, 2008

So you're working happily on your Grails application, coding away, being extremely productive until BOOM! You get a Grails Runtime Exception error page like this when you hit a GSP: What the heck? Reading the stack trace you see that the exception is caused somewhere in a GSP: You've found ...

Accurate branch reports with Grails and Cobertura _1.8_

Thursday, January 31st, 2008

I'm trying to figure out why Cobertura coverage reports on my Groovy and Grails code don't show the branch coverage that I expect they should. I noticed that at some point in the past, Cobertura did show a correct branch report. So I tried the grails code-coverage plugin ...