Questions tagged [grails]

Grails is an Open Source, full stack, web application framework that uses the Groovy programming language (which is in turn based on the Java virtual machine (JVM) and Java). The framework is oriented around high-productivity application development by following the "coding by convention", and uses common Java technologies such as Hibernate and Spring.

Grails is a coding-by-convention framework that leverages well-established frameworks (, , ) to allow programmers to quickly develop web applications.

It touts features such as a zero-XML configuration and a typical web-application architecture.

Grails applications are mainly written in , a dynamic language with strong interoperability with Java and features similar to other languages , , and

Along with its core, Grails has a plugin architecture and library that can provide developers with common web application features like and dynamic UI tools.

Version History:

Latest stable version

Related tags:

  • - Grails object relational mapping implementation, backed by
  • - Groovy Server Pages, the Grails template mechanism
  • - The programming language Grails uses

Online resources:

29868 questions
74
votes
8 answers

Grails vs Roo - why SpringSource is pushing two very similar technologies?

SpringSource (now VMWare) has two very similar technologies: Grails and Spring Roo. I have been using Grails, but I see that SpringSource is actively working on something that is a competitor for that technology and that makes me worried about the…
Piotr Kochański
  • 21,862
  • 7
  • 70
  • 77
72
votes
6 answers

How to calculate elapsed time from now with Joda-Time?

I need to calculate the time elapsed from one specific date till now and display it with the same format as StackOverflow questions, i.e.: 15s ago 2min ago 2hours ago 2days ago 25th Dec 08 Do you know how to achieve it with the Java Joda-Time…
fabien7474
  • 16,300
  • 22
  • 96
  • 124
72
votes
21 answers

Is Grails (now) worth it?

I know this is a duplicate, however, the Grails world has moved on considerably since that question was asked more than a year ago, as has the IDE support in Eclipse, so please don't just blindly close it. I thought the answer was yes and have…
Simon
  • 78,655
  • 25
  • 88
  • 118
65
votes
7 answers

How to access Grails configuration in Grails 2.0?

I have obtained the latest Grails 2.0 milestone, and I am seeing a deprecation warning for the ConfigurationHolder class: org.codehaus.groovy.grails.commons.ConfigurationHolder The deprecation message simply says "Use dependency injection instead"…
DigitalZebra
  • 39,494
  • 39
  • 114
  • 146
64
votes
4 answers

Grails BuildConfig.groovy, difference between build, compile, and runtime?

What's the difference between build, runtime, and compile, in BuildConfig.groovy (1.3.7) grails.project.dependency.resolution = { plugins { build "acme:acme-cache:latest.integration" } dependencies { build…
raffian
  • 31,267
  • 26
  • 103
  • 174
64
votes
9 answers

Convert base64 string to image

I am trying to crop/resize user profile image using jquery plugin namely crop.js which sends user image as base64 via ajax to my controller as $.ajax({ type: "post", dataType: "json", url: "${g.createLink(controller:…
ABC
  • 4,263
  • 10
  • 45
  • 72
64
votes
4 answers

How do I properly set the permgen size?

I have this VM with tomcat, java, and grails in it. I've been getting permgen errors so I looked around and found the solution: set JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m" I use SSH to access the vm and type the…
황현정
  • 3,451
  • 6
  • 28
  • 35
62
votes
7 answers

How to configure a session timeout for Grails application?

In one of controllers in my Grails application I'm preserving a parameter value in a session variable like this: session.myVariable = params.myValue After that, I can access the saved value from different controllers/GSP-pages as long as I actively…
curd0
  • 2,300
  • 3
  • 27
  • 32
60
votes
3 answers

No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode HQL

I have the HQL where I trying to get artifacts that have no classification (when active is 0) artifacts = Artifact.findAll("FROM Artifact WHERE id NOT IN ( SELECT artifact_id FROM Classification WHERE active = 1) AND document_id =…
krs8785
  • 1,097
  • 2
  • 14
  • 24
59
votes
4 answers

Using "$" in Groovy

I see { } are used for closures, and then I believe when a $ is put in front of braces, it is simply doing a variable substitution within a string. I can't find the documentation on how the $ works in the reference ... hard to search on it…
Ray
  • 5,885
  • 16
  • 61
  • 97
58
votes
18 answers

Best practices for deploying Java webapps with minimal downtime?

When deploying a large Java webapp (>100 MB .war) I'm currently use the following deployment process: The application .war file is expanded locally on the development machine. The expanded application is rsync:ed from the development machine to the…
knorv
  • 49,059
  • 74
  • 210
  • 294
57
votes
5 answers

how to parse json using groovy

I want to parse JSON data which is coming in like: { "212315952136472": { "id": "212315952136472", "name": "Ready", "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/195762_212315952136472_4343686_s.jpg", "link":…
Nikhil Sharma
  • 2,221
  • 6
  • 25
  • 31
56
votes
9 answers

What are your favorite Grails debugging tricks?

Grails can be a bit of a bear to debug with its long stack dumps. Getting to the source of the problem can be tricky. I've gotten burned a few times in the BootStrap.groovy doing "def foo = new Foo(a: a, b: b).save()", for example. What are your…
anon
55
votes
2 answers

Bcrypt generates different hashes for the same input?

I just added a registration functionality to my new grails project. For testing it, I registered by giving an email and a password. I am using bcrypt algorithm for hashing the password before saving it to the database. However when I try to login…
adit
  • 553
  • 1
  • 4
  • 5
55
votes
4 answers

How can I return a 404/50x status code from a Grails Controller?

I have a controller that needs to return a 404 page and status code on certain conditions. I can't seem to find out how to do this in Grails. A coworker recommended this method: response.sendError(HttpServletResponse.SC_NOT_FOUND) which works…
Jack Chu
  • 6,791
  • 4
  • 38
  • 44