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

Grails - Redeploy after javascript change

Recently I added conf/ApplicationResources.groovy (using resources plugin) file to my project structure. Here I keep my modules definitions for javascript and css libraries. Before, I was importing libraries with classic g:javascript tag. Now every…
even2be
  • 415
  • 1
  • 3
  • 7
6
votes
2 answers

Grails - Sorting list output without having to have a SortedSet or Comparable model?

I am banging my head up against the wall about what I think would be a very simple problem to resolve in Grails: Say that I have shopping-cart-like model; so a class Cart that hasMany items, and each item belongsTo the cart. In general, I don't…
bprotas
  • 113
  • 1
  • 1
  • 6
6
votes
3 answers

Deserialize joda time from string in grails?

I had a LocalTime field (using Joda Time) in Grails domain class. Class WorkDone{ LocalTime duration } Now I have altered this field to String (with Text constraint) so that it can support duration larger than 24 hrs. String duration The…
6
votes
4 answers

How to mock/stub calls to message taglib in Grails controller

I've got a Grails controller which relies on the message taglib to resolve an i18n message: class TokenController { def passwordReset = { def token = DatedToken.findById(params.id); if (!isValidToken(token, params)) { flash.message =…
Dave Bower
  • 3,487
  • 26
  • 28
6
votes
1 answer

Grails/Groovy URL .getText receive status

I'm including some wordpress contents to my grails app with a customTag everything works fine.Now i want to render some standard-text if the url's status-code is not 200 OK i have this so far def wordpressHp = { body -> // def url =…
john Smith
  • 17,409
  • 11
  • 76
  • 117
6
votes
4 answers

Grails Spring Security AJAX responds with HTML of requested page, not JSON from ajaxSuccess()

So I have been playing with Grails' Spring Security, I'm having a great time but I'm stuck on one little thing regarding logging in via AJAX. I have a login form that posts to /j_spring_security_check via AJAX in order to log in, it is working very…
charlesread
  • 103
  • 2
  • 10
6
votes
1 answer

@ExpectedException in grails unit tests

Anyone used this annotation in grails unit tests? Didnt seem to work for me. Thanks. D Update: the last line of my test below does throw the expected exception. However the test fails (Stack trace too big for here...). I'm using grails 1.2 and…
Derek
  • 760
  • 2
  • 11
  • 20
6
votes
4 answers

Grails layoutResources equivalent for asset-pipeline

I'm trying to setup a SiteMesh layout in grails v2.3.1 using the asset-pipeline plug-in (v1.0.4), but I'm not sure how to handle inclusion of javascript resources in a specific location of my template (like you would using r:layoutResources if using…
mdlandon
  • 125
  • 1
  • 6
6
votes
1 answer

Applying Groovy extensions in Grails produces MissingMethodException for String#toBoolean()

Background Groovy have the feature of adding methods to the existing classes, and I've found some interesting ones. Then I discovered that I need to customize my Grails bootstrap to load them, so I add: def init = { servletContext ->…
user800014
6
votes
1 answer

PostgreSQL to Java Data Types (Grails)

I have the following (Grails) domain object: class Country { Integer id char country_abbr String country_name static mapping = { version false id name: 'id' table 'country' id generator:'identity', column:'id' } static constraints…
Dan
  • 217
  • 2
  • 11
6
votes
5 answers

How to execute a Groovy Script from my Grails app?

Well, it seems a simple task but I didn't manage to make it run. I have a groovy script that runs fine under Windows Vista when calling from prompt: > cd MY_GAILS_PROJECT_DIR > groovy cp src/groovy scripts/myscript.groovy Now, I want to execute…
fabien7474
  • 16,300
  • 22
  • 96
  • 124
6
votes
2 answers

jetty 9: setting up the most basic SSL / https

NOTE: If you want to see the behaviour of this demo app, just go to www.collaborativepowernowinternational.us. Here, select the testssl.PersonController, and you may create a person. Then go and edit the person, where the SSL channel is…
Ray
  • 5,885
  • 16
  • 61
  • 97
6
votes
6 answers

Grails : How to access the params coming as JSON format

from PHP application there is call to grails controller which sends data in JSON format. when i println the params println params which prints [{"courseCategory":null,"courseId":null,"show":null, …
monda
  • 3,809
  • 15
  • 60
  • 84
6
votes
2 answers

using email and username both as login in spring security plugin in Grails

I am using spring security plugin in my Grails application and i would like the users registered to login into the application with username or email address provided during the registration process.(just like fb) I have already looked into the web…
dpak005
  • 241
  • 4
  • 10
6
votes
2 answers

How do you test service or controller methods in grails 2.3

I'm just starting out with grails 2.3 and I have problems getting the unit tests to run. What I've done so far is I've run grails create-app new-app grails create-service NewService grails test-app This produces | Running 1 unit test... |…
Spade
  • 310
  • 3
  • 21