Releases: grails/grails-core
Grails 1.2.5
Grails 1.2.5 is a minor release of Grails with bug fixes and improvements.
Further information about the release can be obtained using the links below:
See the Grails 1.2 release notes for more information about new features.
Grails 1.3.5
For further information about the release see the below links:
New Features & Improvements
Now using Groovy 1.7.5
Release notes for Groovy 1.7.5 can be found here.
New Feature: Named Queries Now Support Sorting
The list method attached to named queries now support the same parameters as the static list method that is added to domain classes including "sort", "ordering", "ignoreCase" etc...
Person.recentPublications.list(
sort: 'title', order: 'desc', ignoreCase: true)
New feature: view information about templates used to render a single url
Related issue: GRAILS-5163
GSP templates are re-used in large web applications by using the g:render taglib. A lot of small templates can be used to render a single page.
It might be hard to find out what gsp template actually renders the html seen in the result.
The debug templates -feature adds html comments to the output. The comments contain debug information about gsp templates used to render the page.
Usage is simple: append "?debugTemplates" or "&debugTemplates" to the url and view the source of the result in your browser.
"debugTemplates" is restricted to the development mode.
Here is an example of comments added by debugTemplates :
<!-- GSP #2 START template: /home/user/sampleapp/grails-app/views/_carousel.gsp precompiled: false lastmodified: 22.6.2010 10:45 -->
.
.
.
<!-- GSP #2 END template: /home/user/sampleapp/grails-app/views/_carousel.gsp rendering time: 115 ms -->
Each comment block has a unique id so that you can find the start & end of each template call.
Improvement: GSP reloading is supported for precompiled GSPs now
Related issue: GRAILS-5787
Details are in the Grails reference documentation
i18n reloading is also enabled if GSP reloading is enabled. New message_*.properties files won't be detected. Only changes to existing properties files are reloaded (5 sec interval).
Example of enabling GSP reloading in Config.groovy.
grails.gsp.reload.enable = true
It has been tested with Tomcat, that you can directly edit the GSP files found in the "exploded war directory" found f.e. in tomcat_home/webapps/myapp-0.1/WEB-INF/grails-app/views
. You can also edit the messages.properties files found in the tomcat_home/webapps/myapp-0.1/WEB-INF/grails-app/i18n
directory. Make sure you backup your changes if you are using war-files for deployment. The changes will get overwritten by Tomcat when you deploy a new version of the application. You might even lose your changes after a restart if you use war-file deployment. Therefore it's recommended to use "exploded war deployment" if you plan to use this feature.
Improvement: URL link creation is cached by default
Grails will cache links created with the g:createLink tag (and other tags that create links using the Grails UrlMappingsHolder/UrlCreator interfaces) in a weighted LRU cache. The size of the cache is 160000 characters by default. The maximum cache size (number of characters in the cache) can be controlled with grails.urlcreator.cache.maxsize
config parameter:
// set UrlCreatorCache size to 200000 characters
grails.urlcreator.cache.maxsize = 200000
// disable UrlCreatorCache
grails.urlcreator.cache.maxsize = 0
The LRU cache implementation is [concurrentlinkedhashmap|https://code.google.com/p/concurrentlinkedhashmap/] 1.0_jdk5. This is a new dependency in Grails 1.3.5.
The same cache implementation is used for caching url matches (GRAILS-6622, fixes a memory leak in url matching).
Improvement: The application instance can be easily accessed inside resources.groovy
Related issue: GRAILS-6363
Previously you had to either use the ApplicationHolder
(or ConfigurationHolder
if you wanted the config) to get access to this. Now you can just refer to "application"�.
import my.company.mock.MockImpl
import my.company.MyBeanImpl
beans = {
if (application.config.my.company.mockService) {
myBean(MockImpl) {
bookService = ref("bookService")
}
}
else {
myBean(MyBeanImpl) {
bookService = ref("bookService")
}
}
}
New Feature: Enhancements to functional testing support
The functional testing support provided to plugins has been enhanced to include testing remote instances or running tests against a WAR deployed version of the application. Not all testing plugins will be immediately compatible, but support should follow quickly.
For more information see the functional testing section in the manual
Improvement: Tomcat JVM can be configured when using run-war
By default, the Tomcat plugin uses a forked JVM with a max heap size of 512m which may not be enough for your application. You can now control the JVM options via the the following parameter in BuildConfig.groovy:
grails.tomcat.jvmArgs = ["-Xmx1024m", "-XX:MaxPermSize=256m"]
Notice about performance when grails.logging.jul.usebridge is enabled
The default Config.groovy
for new Grails applications has grails.logging.jul.usebridge
setting enabled (GRAILS-6778, will change in 1.3.6).
The SLF4J documentation mentions the negative performance impact of the [JUL to SLF4J bridge|http://www.slf4j.org/legacy.html#jul-to-slf4j].
In Grails applications it's recommended not to enable grails.logging.jul.usebridge
in production environments.
This release includes previous fixes in 1.3.x release train.
Grails 1.2.4
Grails 1.2.4 is a minor release of Grails with bug fixes and improvements.
Further information about the release can be obtained using the links below:
See the Grails 1.2 release notes for more information about new features.
Create scripts purge redundant artifact suffixes
Improved the create scripts to handle redundant artifact suffixes.
For example:
grails create-service com.example.FooService
now creates /com/example/FooService.groovy
instead of /com/example/FooServiceService.groovy
Applies to:
- create-controller
- create-filters
- create-service
- create-taglib
- create-integration-test
- create-unit-test
See GRAILS-6381 for more detail
Create Skinny Wars With Plugin Dependencies Included
See GRAILS-6422 for more detail
Grails 1.3.4
For further information about the release see the below links:
Groovy 1.7.4
Grails 1.3.4 includes Groovy 1.7.4. Read the Groovy 1.7.4 Release Notes for details on the latest version of the Groovy language.
Create scripts purge redundant artifact suffixes
Improved the create scripts to handle redundant artifact suffixes.
For example:
grails create-service com.example.FooService
now creates /com/example/FooService.groovy
instead of /com/example/FooServiceService.groovy
Applies to:
- create-controller
- create-filters
- create-service
- create-taglib
- create-integration-test
- create-unit-test
See GRAILS-6381 for more detail
Grails 1.3.3
8th of July 2010
Further information about the release can be obtained using the links below:
This release includes previous fixes in 1.3.x release train.
Grails 1.2.3
Grails 1.2.3 is a minor release of Grails with bug fixes and improvements.
Further information about the release can be obtained using the links below:
See the Grails 1.2 release notes for more information about new features.
Grails 1.3.2
17th of June 2010
Grails is a dynamic web application framework built on Java and Groovy, leveraging best of breed APIs from the Java EE sphere including Spring, Hibernate and SiteMesh. Grails brings to Java and Groovy developers the joys of convention-based rapid development while allowing them to leverage their existing knowledge and capitalize on the proven and performant APIs Java developers have been using for years.
Further information about the release can be obtained using the links below:
This release includes previous fixes in 1.3.x release train.
Groovy 1.7.3 Support
Grails 1.3.2 comes with the recently released 1.7.3 version of the Groovy language. See the Groovy 1.7.3 Release Notes for info.
Spring 3.0.3 Support
Grails 1.3.2 comes with the recently released 3.0.3 version of The Spring Framework. See the Spring 3.0.3 Release Notes for info.
Typo detection for scripts
If you mis-type a script name, Grails will find the closest matches to what you typed and prompt you to choose from a list of existing scripts:
~/workspace/testapp $ grails create-doman-class testapp.Author
Welcome to Grails 1.3.2 - http://grails.org/
Licensed under Apache Standard License 2.0
...
Script 'CreateDomanClass' not found, did you mean:
1) CreateDomainClass
2) CreateApp_
3) CreateScript
4) CreateFilters
5) CreateUnitTest
Please make a selection or enter Q to quit:
The .find Method Now Supports The Query Cache
def musicians = Musician.find('from Musician where name = :name', [name: 'Brian'], [cache: true])
Improved Support for HTTP proxies
Grails' command line has been improved to support multiple different proxy configurations:
grails add-proxy client --host=proxy-server --port=4300 --username=guest --password=guest
grails set-proxy client
grails clear-proxy
grails add-proxy local --host=localhost --port=4300
grails set-proxy local
Grails 1.3.1
17th May 2010
Further information about the release can be obtained using the links below:
Filter Ordering
The order in which filters are executed may now be influenced by expressing that a filter depends on some number of other filters.
class MyFilters {
def dependsOn = [MyOtherFilters]
def filters = {
...
}
}
class MyOtherFilters {
def filters = {
...
}
}
GSP Tag "unless"
A new GSP tag has been provided called "unless", which acts as a counterpart to the existing "if" tag.
<g:unless test="${cacheEnabled}">
Tag Body Goes Here
</g:unless>
Improved Query Caching
The findAll query method now supports taking advantage of the 2nd level cache.
Book.findAll("from Book as b where b.author=:author", [author:'Dan Brown'], [cache: true])
Nested Named Queries
Named queries may now be nested.
class Publication {
String title
String author
Date datePublished
Integer numberOfPages
static namedQueries = {
recentPublications {
def now = new Date()
gt 'datePublished', now - 365
}
publicationsWithBookInTitle {
like 'title', '%Book%'
}
recentPublicationsWithBookInTitle {
// calls to other named queries...
recentPublications()
publicationsWithBookInTitle()
}
}
}
TagLib Testing
TagLibUnitTestCase
now supports testing custom tags that access the dynamic pageScope
property. The pageScope property is now dynamically added to tag libraries at test time.
Grails 1.3.0
11th of May 2010
SpringSource are pleased to announce the 1.3 release of the Grails web application development framework.
Further information about the release can be obtained using the links below:
Groovy 1.7 Support
Grails 1.3 comes with the recently released 1.7 version of the Groovy language, which includes loads of new features like anonymous and nested class support, power asserts and more. See the Groovy 1.7 release notes for info.
JUnit 4
Grails 1.3 now uses JUnit 4 to run tests. JUnit 4 features a richer assertion API and many features like timeouts, ignores, class level before and after methods, hamcrest matchers, assumptions, theories and more.
Pre Grails 1.3 tests are fully backwards compatible.
Improvements to Modular Plugin Development
There are a couple of significant improvements to modular application development with plugins:
- You can now override any plugin provides class, view or template simply by creating an equivalent class (same package/class name) or GSP in your application
- You now no longer need to run package-plugin in each inline plugin prior to using or building a WAR file
Maven Repository Support
Grails now has full support for publishing plugins to (using the [maven publisher|http://grails.org/plugin/maven-publisher] plugin) and reading plugins from Maven compatible repositories.
You can easily configure additional plugin repositories in BuildConfig.groovy using the Ivy DSL introduced in Grails 1.2:
repositories {
mavenRepo "http://repository.codehaus.org"
}
The [central Grails repository|http://grails.org/plugin/home] can also now be easily enabled and disabled by including using the @grailsCentral@ method:
repositories {
grailsCentral()
}
Declarative Plugin Dependencies
Alongside the new Maven repository support you can now declare plugin dependencies using the Ivy DSL:
plugins {
runtime ':hibernate:1.2.1'
}
Which allows you to easily control plugin exclusions:
plugins {
runtime( ':weceem:0.8' ) {
excludes "searchable"
}
}
And the scope of a plugin:
plugins {
build( ':weceem:0.8' )
}
Dirty Checking in GORM
GORM includes new methods to check whether an object has been modified:
def airport = Airport.get(10)
assert !airport.isDirty()
airport.properties = params
if (airport.isDirty()) {
// do something based on changed state
}
You can also check if individual fields have been modified:
def airport = Airport.get(10)
assert !airport.isDirty()
airport.properties = params
if (airport.isDirty('name')) {
// do something based on changed name
}
GORM Support For Derived Properties
GORM now provides a mechanism for taking advantage of Hibernate's derived properties support.
class Product {
Float price
Float finalPrice
static mapping = {
finalPrice formula: 'PRICE * 1.155'
}
}
Named Queries Support Additional Criteria
Additional criteria may be supplied to named queries at invocation time:
class Publication {
String title
String author
Date datePublished
Integer numberOfPages
static namedQueries = {
recentPublications {
def now = new Date()
gt 'datePublished', now - 365
}
}
}
def books = Publication.recentPublications {
or {
like 'author', 'Tony%'
like 'author', 'Phil%'
}
}
Chaining Named Criteria
Named criteria may be chained together. When criteria are chained together, the query will be generated
as if all of the chained criteria had been combined in a single criteria closure.
// recent publications with 'Book' in the title
def books = Publication.recentPublications.publicationsWithBookInTitle.list()
// old publications with more than 500 pages and with 'Book' in the title
def books = Publication.oldPublicationsLargerThan(500).publicationsWithBookInTitle.list()
Global application layouts
You can now define a layout to be used by all pages that don't specifiy one otherwise by creating a @grails-app/views/layouts/application.gsp@ file. The name of the layout to use can also be modified in Config.groovy:
grails.sitemesh.default.layout='myLayoutName'
New GSP Tag - join
<g:join in="['Grails', 'Groovy', 'Gradle']" delimiter="_"/>
Produces:
Grails_Groovy_Gradle
PDF Publishing for Grails doc
The 'grails doc' command can now produce a PDF document from your user documentation sources:
grails doc --pdf
An easy way to create a template grails doc project has also been introduced:
grails doc --init
Grails 1.2.2
Grails 1.2.2 is a minor release of Grails with bug fixes and improvements.
Further information about the release can be obtained using the links below:
See the Grails 1.2 release notes for more information about new features.