Grails, release 0.6 (August 2007) -------------------------------------------------- http://grails.org 1. INTRODUCTION ============================================================================= Grails is a web based application framework based on the Groovy language that endorses the DRY (don't repeat yourself) and coding-by-convention philosophies. Grails runs on the Java Virtual Machine and thus has access to the entire Java Platform. With Grails you can easily create web applications thanks to: - a complete development and deployment environment. All dependencies and configuration that is required to the run Grails applications in a web server are provided by Grails. The only thing you have to worry about is your application code. - inclusion of an embedded Jetty web server - development mode that automatically reloads changes made to application code, without having to restart the web server. - automatic persistence mapping of domain classes with automatic relationship management. - scaffolding on data access classes for rapid development of CRUD (Create, Read, Update, Delete) operations. - powerful web framework with dynamic tag libraries and support for Groovy Server Pages (GSP) 2. GETTING STARTED ============================================================================= To get started takes these steps: - create a GRAILS_HOME environment variable that points to the path of the Grails distribution (the folder contain this file). - add the bin folder in the Grails distribution to the PATH environment variable On a Windows computer these step are done as follows: > set GRAILS_HOME=C:\download\grails > echo %GRAILS_HOME% C:\download\grails > set PATH=%GRAILS_HOME%\bin;%PATH% On a Unix-like computer these steps are done as follows: > set GRAILS_HOME=~/download/grails > export GRAILS_HOME > echo ${GRAILS_HOME} ~/download/grails > cd ${GRAILS_HOME} > chmod a+x bin/grails > set PATH=${GRAILS_HOME}/bin:${PATH} > export PATH You can now run the grails command, as follows: > grails create-app YourProject For more info checkout the Grails homepage at http://grails.org 3. UPGRADING / KNOWN ISSUES ============================================================================= To upgrade your existing Grails projects you must run: grails clean grails upgrade ...for each project. There are some unavoidable issues that may affect you when upgrading to 0.5 from a previous version: 1. If you have an old default index.jsp, it will not function correctly due to a change in a property name. Remove the file if you have not customized it, or change the reference to the "controllers" property to "controllerClasses" 2. Your custom taglibs that call other tags will need to be changed. Tags called from within a tag now return a string containing the content instead of writing to out, so you must do something like: out << theOtherTag(attrs) 3. Your taglibs, if they call their own non-tag closures as if they are methods, will not function correctly if the closure has less than 3 arguments. Change such code to: yourClosureName.call(args) 4. Tag bodies return strings instead of writing to out, so you must change code that calls body() to: out << body() 5. View loading mechanisms have changed, so if you need to load a view directly or check for its existence, you must now use a resource loader: def resourceLoader = ctx.containsBean('groovyPageResourceLoader') ? ctx.groovyPageResourceLoader : ctx def resource = resourceLoader.getResource(uri) if(resource && resource.file && resource.file.exists()) { ... } 6. Note the deprecation warnings you see in your console, these need to be tackled prior to 0.6 where these old features will be removed. 7. The DataSource and Log4j mechanisms have changed. There were previously 3 *DataSource.groovy files inside grails-app/conf. There is now only a single DataSource.groovy file which contains all configurations for all environments. Log4j is no longer configured with log4j properties files but instead with the global configuration Groovy script. See grails-app/conf/Config.groovy. ============================================================================= Enjoy working with Grails. The Grails team