Binding a Grails date from params in a controller

Grails Version >= 2.3 A setting in Config.groovy defines the date formats which will be used application-wide when binding params to a Date grails.databinding.dateFormats = [ ‘MMddyyyy’, ‘yyyy-MM-dd HH:mm:ss.S’, “yyyy-MM-dd’T’hh:mm:ss’Z'” ] The formats specified in grails.databinding.dateFormats will be attempted in the order in which they are included in the List. You can override these application-wide … Read more

Groovy/Grails :: Ruby/Rails :: 2011 State of the framework

Rails and Grails are both excellent frameworks with their current releases. You really can’t go wrong with either. Here are some things I find interesting about them though: Rails Rails (Ruby) does not scale as well as Grails (Groovy). You will need more horsepower to run your application. This isn’t a big deal at all … Read more

Overriding grails.views.default.codec=’html’ config back to ‘none’

To summarize the various levels at which the codec can be applied: Set Config.groovy’s grails.views.default.codec=”html” to get HTML escaping by default on all ${expressions} in the application. Then when you want to default a whole page back to none, use the directive: <%@page defaultCodec=”none” %> or <%@ defaultCodec=”none” %> To disable HTML encoding for one … Read more

How can i set default value in grails domain class

This will be possible in 2.2 which should be released this week or next. See http://jira.grails.org/browse/GRAILS-5520 for the relevant feature request. The syntax will be static mapping = { name defaultValue: “‘Cash'” } For now you’ll need to do what you’re doing – set the value as the default value of the field. You can … Read more

Difference between findAll, getAll and list in Grails

getAll is an enhanced version of get that takes multiple ids and returns a List of instances. The list size will be the same as the number of provided ids; any misses will result in a null at that slot. See http://grails.org/doc/latest/ref/Domain%20Classes/getAll.html findAll lets you use HQL queries and supports pagination, but they’re not limited … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)