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
2 answers

Grails scaffold 404 with byte[]

I'm trying to upload a file in grails. The generated scaffold is not working for me and giving me a 404 looking for 'save.jsp' Domain class Simple{ byte [] avatar static constraints = { avatar nullable: true, maxSize: 1000000 …
Oliver Shaw
  • 5,235
  • 4
  • 26
  • 35
6
votes
2 answers

How do you unlock a domain object after calling lock()?

If you call lock() on a domain instance or statically on the class, and then you decide there is nothing to do to the object, is there a way to manually and immediately release the lock?
greymatter
  • 840
  • 1
  • 10
  • 25
6
votes
3 answers

Have a favorite custom Grails tag?

I've been using tags in my projects. I was browsing the custom tags on grails.org to find some new tags for my library. http://www.grails.org/Contribute+a+Tag I was wondering if people in the StackOverflow community have a favorite custom tag that…
anon
6
votes
7 answers

What is the best practice for passing variables from one HTML page to another?

I'm relatively new to web application programming so I hope this question isn't too basic for everyone. I created a HTML page with a FORM containing a dojox datagrid (v1.2) filled with rows of descriptions for different grocery items. After the…
Kevin
  • 956
  • 3
  • 11
  • 24
6
votes
3 answers

inheritance in Grails domain model

My Grails app's domain model has the following requirements: a user belong to zero or one organisations an organisation is either a charity or a company charities and companies have some some common fields and also some (non-nullable) fields that…
Dónal
  • 185,044
  • 174
  • 569
  • 824
6
votes
2 answers

Convert grails domain object to JSON and manipulate it

I have a grails object that I am converting using def json = object as JSON. After I have it converted I want to add one more property called pin to the JSON which looks like the following. [location:[lat:23.03, lon:72.58]] Only way to do this so…
Sap
  • 5,197
  • 8
  • 59
  • 101
6
votes
2 answers

Intelligent folder structure for grails 2.3.4 in combination with angular js

What would be an intelligent folder structure for grails 2.3.4 in combination with angularjs without using the grails angularjs plugin? Currently I have packed everything into the webapp folder.
user2051347
  • 1,609
  • 4
  • 23
  • 34
6
votes
2 answers

Difficulty running grails tests in IntelliJ : Illegal use of nonvirtual function call

Lately I've been trying to run my spock tests in IntelliJ (which used to work beautifully and had great debugging / specific test re-running on failure features) and in the past few months I've began getting the following error: | Error Error…
Will Buck
  • 1,500
  • 16
  • 25
6
votes
1 answer

Grails - How to unregister an already registered object marshaller

I have a domain class Person in my grails application that I need to output in different forms (of JSON) depending on the context. In one context, I need to render only a couple of fields (say id and name). In another context, I want to render a…
techfoobar
  • 65,616
  • 14
  • 114
  • 135
6
votes
4 answers

How to get the ordinal suffix of a number for many languages in Java or Groovy

I am building a multi-languages grails website and I need to get the ordinal suffix of a number for several languages like English, French, Spanish, German and Italian. I believe that this issue is quite common for multi-languages website owners. I…
fabien7474
  • 16,300
  • 22
  • 96
  • 124
6
votes
2 answers

grails test-app Only classes and closures can be used for attribute 'value' in @grails.test.mixin.TestFor

I'm starting with testing for Grails (version 2.2.4). When I run: grails test-app I got: Error Compilation error compiling [unit] tests: startup failed: Log: /myproject/test/unit/app/AutocompleteServiceTests.groovy: 11: Only classes and closures…
Ignacio Ocampo
  • 2,693
  • 1
  • 20
  • 31
6
votes
1 answer

Grails extract body data from the request

I have some controller (ExampleController) that receives requests with content-type application/x-www-form-urlencoded. I need to send all the request data to a different URL using POST request. The data needs to be in the same order as received…
royB
  • 12,779
  • 15
  • 58
  • 80
6
votes
1 answer

How to connect postgres database with Grails 2.3.4

I'm new to Grails. I'm trying to connect postgresql 9.0 database server with grails 2.3.4. I have added postgresql-9.0-801.jdbc3.jar file into the lib folder of grails application.When i'm running the application on Intellij editor then getting…
Little bird
  • 1,106
  • 7
  • 28
  • 58
6
votes
3 answers

Grails shell not seeing domain objects

I'm a grails newbie (and a groovy newbie), and I'm working through some grails tutorials. As a new user, the grails shell is a really useful little tool for me, but I can't figure out how to make it see my classes and objects. Here's what I'm…
Brandon Yarbrough
  • 37,021
  • 23
  • 116
  • 145
6
votes
3 answers

grails change Date format in gsp view

When I try to use date format tag in gsp view to change the format of my date but it doesn't work. This is my code: class MyDate { Date date } MyDateController: .... def unixSeconds = params["date"].replaceAll("\"", "") as long …
Jils
  • 783
  • 5
  • 12
  • 32