The Grails documentation is very clear on how to specify specific table and column names for your domain classes (in Section 5.5.2 Custom ORM Mapping). But what if you need to specify the schema as well? Fortunately it is just as easy, if less well-documented.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Of course, when all of your domain tables are in the same schema, you should simply specify a default schema in DataSource.groovy. The property is hibernate.default_schema.
Envjs is an implementation of the DOM in Javascript. Together with Rhino, it can function as a headless web browser in Java. Picture HtmlUnit, but with flawless Javascript support. For instance, the latest version of JQuery works flawlessly in Envjs on Rhino but won't even load in HtmlUnit.
Here's a simple way to tie them together in JUnit. Wonderful testing frameworks to follow (looking at you, Mike ;)
Not too many Groovy-isms here, can easily be converted to plain Java.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One must-have feature in any modern web stack is the ability to automatically restart/refresh the development server when you edit the source code. It is critical for developer workflow that the feedback loop be as tight as possible. Here source code refers to actual class definitions, templates (JSPs, GSPs, haml files, etc...), static content (javascript, css, images), AND configuration (I'm looking at you, struts.xml).
All web frameworks which do not support automatic updating of all content during development shall hereafter be referred to as "Legacy Web Frameworks". Is your shop using them?
Justin Voss and I have been hard at work on a web micro-framework called Ratpack (inspired by Ruby's Sinatra). Lest it become a Legacy Web Framework right out of the gate, we've implemented basic auto-reloading right away. Feel free to grab this for other uses, as it works independently.
groovy runapp.groovy app/myapp.groovy app
The script app/myapp.groovy will be killed and re-run when any content in the app directory changes.
Since Ratpack uses Jetty, there are probably better solutions. Feedback is welcome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Writing a Grails app? Find out why so many Rubyists swear by Haml for writing views.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Interested parties have created JHaml, a Java implementation of Haml, and a corresponding Grails plugin. (Patches welcome!)
To try it out, just grab the plugin:
grails install-plugin haml
Then add this bean definition to your grails-app/conf/spring/resources.groovy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters