Grails Goodness: Set Request Locale in Unit Tests
There is really no excuse to not write unit tests in Grails. The support for writing tests is excellent, also for testing code that has to deal with the locale set in a user’s request. For example we...
View ArticleGrails Goodness: Render Binary Output with the File Attribute
Since Grails 2 we can render binary output with the render() method and the file attribute. The file attribute can be assigned a byte[], File, InputStream or String value. Grails will try to determine...
View ArticleGrails Goodness: Using Closures for Select Value Rendering
To generate an HTML select we can use the Grails tag <g:select .../>. We use the optionValue attribute to specify a specific property we want to be used as the value. But we can also define a...
View ArticleSpicy Spring: Inject your custom method argument in Spring MVC using...
In Spring MVC we get some method argument types resolved by default and injected in Spring MVC controller methods. Some examples are Model, Locale and OutputStream. What if we want to inject a custom...
View Article