Questions tagged [grails-2.0.4]

Grails is a dynamic web application framework built on Java and Groovy

14 questions
3
votes
2 answers

How to tell Grails to render JSONNull as null?

I have a JSON object returned from Groovy's HTTPBuilder. THE JSON contains some null values represented as JSONNull objects. The problem is that when I try to render the JSON back in a response, I get an error when it tries to render the JSONNull. I…
Adam
  • 43,763
  • 16
  • 104
  • 144
2
votes
2 answers

how to bypass spring security login check in grails

I have controller method, Which returns json data and does not have security check logic. def getJsonData(){ // return json } I am doing ajax request from a php page from another server(cross domain). $.ajax({ type: "GET", …
n92
  • 7,424
  • 27
  • 93
  • 129
2
votes
0 answers

In Grails, is it possible to change the subtype of a persistent entity?

Say I have the following classes: class Fruit { ... } class Apple extends Fruit { ... } class Orange extends Fruit { ... } Let's say a user wants to create a new Apple. They pick a type from a dropdown, and I use a service to translate the type…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
2
votes
1 answer

In Grails, how do I mock GrailsDomainBinder in a unit test?

I have a bunch of subclasses like so: abstract class Fruit { ... String getType() { // get the discriminator value for this type GrailsDomainBinder.getMapping(this.class).discriminator } } class Apple extends Fruit { …
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
2
votes
1 answer

In Grails, how do I get a list of all discriminator values for all subclasses of a base type?

Let's say I have the following classes: class Apple extends Fruit { ... } class Banana extends Fruit { ... } class Grape extends Fruit { ... } class Kiwi extends Fruit { ... } And so on and so forth. I now need to display a dropdown that contains a…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
2
votes
3 answers

In Grails, how do I search for something in the DB based on its discriminator?

Let's say I have the following classes: abstract class Fruit { String name static mapping = { discriminator column: 'type' } class Banana extends Fruit { static mapping = { discriminator: 'Banana' } } class…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
1
vote
0 answers

How do I properly map a domain that has a one-to-many as well as a many-to-one to another domain?

Let's say I have the following domain objects: class Family { Person primaryContact static hasMany = [ members: Person ] } class Person { static belongsTo = [ family: Family ] } In other words, a Family can have multiple members, but…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
1
vote
1 answer

Hibernate OptimisticLockingFailureException not throwing when it's supposed to

Let's say I have the following domain class: class Book { String name // more properties here, but name is the only one relevant for this example } I'd like to update its name via a view. I'm using the following form to update it:
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
1
vote
1 answer

Grails Spock integration test redirectedUrl different between localhost test-app and build server test-app

I have a Spock integration test that looks something like this: class PriceTierControllerIntegrationSpec extends IntegrationSpec { PriceTierController controller def setup() { controller = new PriceTierController() } def…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
1
vote
1 answer

How to add plugin project as a dependency to my main projects

My requirement is as below: I will be having three projects. Main project (Grails project) Main project adaptor (Grails project) Domains plugin project (Grails project) Domains plugin project will be having all of the domain classes and its…
0
votes
1 answer

How to resolve errors in grails application after upgrading to 2.3.6

I recently updated my grails project from 2.0.4 to 2.3.6, which is giving some errors while saving a form which contains multipart data (file attachments), Its giving me the error for the file attachment fields like rejected value:…
n92
  • 7,424
  • 27
  • 93
  • 129
0
votes
1 answer

How to save object in grails

I have grails 2.0.4 app, I have new domain class as below, which contains around 50 properties class Test{ int testField1 int testField2 int testField2 . . int testFieldN } And I want to do as follows, Display Value Value to…
n92
  • 7,424
  • 27
  • 93
  • 129
0
votes
1 answer

How to increase grails2.0.4 performance in Development mode?

I am working with grails framework. It takes too much time to respond a request from browser. Due to this issue i have to restart the server too many times. I will highly appreciate for your accurate answer.
JamesKarty
  • 11
  • 2
-1
votes
1 answer

grails 2.5.6 Error executing script RunApp

The application is upgraded from grails 2.0.4 to 2.5.6 When running grails war or grails run-app, it fails with a message | Environment set to development..... | Packaging Grails application..... | Error Error executing script RunApp:…