Category Archives: Grails

Dependency injection in the Grails Console

If you have a service named MyService with a function named HelloWorld, you can access it via dependency injection by adding def MyService def result = MyService.HelloWorld() But to test in the console you need to do this: def service … Continue reading

Posted in Grails | Comments Off

How to choose default Java version

Just installing new Java flavours does not change the default Java pointed to by /usr/bin/java. You must explicitly set this: Open a Terminal window Run sudo update-java-alternatives -l to see the current configuration and possibilities. Run sudo update-java-alternatives -s XXXX … Continue reading

Posted in Grails | Leave a comment

Using spring security core plugin

Install the plugin $ grails install-plugin spring-security-core Create domain classes for User Role and UserRole $ grails s2-quickstart com.yourapp User Role Create a persistent token domain class for storing remember-me cookie information in the database $ grails s2-create-persistent-token com.yourapp.PersistentLogin

Posted in Grails | Leave a comment