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
6
votes
1 answer

Deploying multiple grails applications with Apache/Tomcat + Virtual Hosts

I haven't been able to figure out how to deploy multiple grails applications with Apache/Tomcat where a virtual host is mapped to each grails app I can get it so that http://virtualhost1.example.com/myGrailsApplication-0.1/ works, but what I want…
user122299
6
votes
3 answers

UrlMapping to static files in Grails

I want to map the static files sitemap.xml and robots.txt which a located in my web-app directory. The urls should be as follows: http://www.mydomain.com/sitemap.xml http://www.mydomain.com/robots.txt How do I have to set the url mapping to make…
Michael
  • 32,527
  • 49
  • 210
  • 370
6
votes
2 answers

New Grails domain class is not creating a table in the database

I just created a new grails domain class on a project I just started working on. I know the datasources are setup correctly since we already have a bunch of domain classes that are updating to the database just fine. The error I get: Caused by…
Brandon Wagner
  • 893
  • 9
  • 27
6
votes
4 answers

How to get current_user by using Spring Security Grails plugin in GSP

I am newbie in Grails. I am using Spring Security Grails plugin for Authentication purpose. I want to get current user in my view gsp file. I am trying like this ...
Free-Minded
  • 5,322
  • 6
  • 50
  • 93
6
votes
2 answers

Groovy Grails handle controller parameters

I do an AJAX request from mt front-end with array as parameter. Example of the array: arr = [13, 56, 43] When in Grails controller I print params I get arr[]:[13, 56, 43]. However, when in front-end array consists of only one element (arr = [25],…
user721588
6
votes
1 answer

Using 'get' in an action for Grails controllers causes action to execute even when not called

Issue: A controller's action has a render tag without passing in a model. There exists an action that begins with the word 'get'. grails-app/views/site/home.gsp: homepage SiteController.groovy: class SiteController { def index() { …
user1661781
  • 327
  • 2
  • 16
6
votes
1 answer

Override getter and setter in grails domain class for relation

How to override getter and setter for field being a relation one-to-many in grails domain class? I know how to override getters and setters for fields being an single Object, but I have problem with Collections. Here is my case: I have Entity domain…
kpater87
  • 1,190
  • 12
  • 31
6
votes
2 answers

GORM get/find resource by ID using MongoDB in Grails

Grails makes it easy to get a domain object by ID (handy for building a REST API). A controller to retrieve a resource can be as simple as: MetricController.groovy import grails.converters.JSON class MetricController { def index() { def…
Dem Pilafian
  • 5,625
  • 6
  • 39
  • 67
6
votes
3 answers

In Grails, how to invoke a controller action from a g:select

I'm using a g:select (actually, a g:currencySelect) in my view. I want a controller action to fire as soon as the user changes the value in the resulting select box. How can I do this?
Dick Chesterwood
  • 2,629
  • 2
  • 25
  • 33
6
votes
2 answers

permgen garbage collection takes multiple Full GC

We are running grails and we are noticing multiple full garbage collections are needed to clear out the permgen space. 2013-06-06T16:11:27.016+0000: 32582.145: [Full GC 32582.145: [CMS2013-06-06T16:11:45.404+0000: 32600.532:…
tcollins
  • 61
  • 1
  • 3
6
votes
3 answers

Grails & HibernateException: connnection proxy not usable after transaction completion

I just ran into a problem I don't understand. Our grails (2.2.2) app is throwing the following exception just after the first user logged in. Once that one's done, no one has ever seen it again. Currently we're reproducing it with a Geb test. Caused…
Moritz
  • 489
  • 1
  • 5
  • 18
6
votes
1 answer

Grails spring-security static rules for rest resource seems not working properly

I have an Grails (2.0.4) application using Spring Security plugin (version 1.2.7.3) and the secured annotation approach (the default one, more here). Now, I have these URLs in UrlMapping.groovy with the resource key or the controller/action pair,…
lucke84
  • 4,516
  • 3
  • 37
  • 58
6
votes
2 answers

How to ensure data integrity when using Table Per Subclass?

I am using the table per subclass strategy in Grails by setting the tablePerHierarchy property of the static mapping field in my superclass to false. This way, Grails creates one table for my superclass and one additional table for each of my…
Stephan B
  • 837
  • 1
  • 16
  • 41
6
votes
3 answers

How to set default value for Domain Class Values in Grails 2.2?

In my Grails domain class I want to set default values which do persist in the database. I use mysql as database. I tried to do this: class A { long someValue = 1 long someOtherValue boolean someBool = true boolean someOtherBool …
Michael
  • 32,527
  • 49
  • 210
  • 370
6
votes
2 answers

Grails "Cannot set readonly property: programId"

I got thrown into an existing grails project and one of the issues i'm having is that when saving something a batch, i get the error: Cannot set readonly property: programId Here's my save snippet that causes the error // Create a batch def batch =…
Catfish
  • 18,876
  • 54
  • 209
  • 353
1 2 3
99
100