grails

Grails web flow

Hi, Is there any way to pass model data to a view state? Consider the following example view state: class BookController { def shoppingCartFlow = { showProducts { on("checkout").to "enterPersonalDetails" on("continueShopping").to "displayCatalogue" } } } If I want to pass the data model [products: Product.list...

Grails Ignoring @Id Annotation

I'm trying to use an existing database with Grails. My DataSource.groovy starts with this: import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration dataSource { configClass = GrailsAnnotationConfiguration.class pooled = true driverClassName = "com.mysql.jdbc.Driver" username = "root" password...

Problem with grails web app running in production: "No such property: save for class: JsecRole"

I've got a grails 1.1 web app running great in development but when I try and run it in production with an sqlserver database it crashes in a weird way. The relevant part of my datasource.groovy is as follows: environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop','update' ...

Grails: Building an Application for an existing Database. How to generate fitting Domainclasses

Hi, i got an old Firebird Database with a lot of content. Is there an easy way to get the content of this Database without rewriting the tables from Database for an Grails Application? An example would be nice. Thank you! ...

USER_HOME for grails on Windows

Does anyone know how to set the USER_HOME on windows so that when I create an app it's not created inside 'Documents and Settings'. I know how to override it inside the app but I want to change it so that it defaults to a certain folder. Thanks. ...

How to get around File Upload Exception for Grails on Google App Engine?

I am writing an application on Google App Engine using Grails. Everything works great on my local dev environment. However on live server, I get exception when trying to upload file. When Grails runtime tries to parse controller params, it uses Apache.Commons.FileUpload, which writes temp file and Google doesn't like it. What is the be...

Looking for a great Java Framework w/ ORM for an Enterprise App - Grails? Aribaweb? ?

I realize that this may be tantamount to asking, "what's the best programming language?" (lots of debate and emotion), but I don't know what do but ask YOU about what Web Frameworks you've had good experience with. Practically, to be adopted by our IT folks it needs to be HOSTED on Java; thus the two I listed in the subject above. I ins...

Grails link taglib use outside of GSP

I'm trying to use the taglib call there's attribute parameters, but also the stuff inside the tag itself which the link taglib uses. I can't find the attribute to pass in to a g.link() call to have it render the text of the link. I've tried 'body' and 'link' and 'text' and 'linkText' already - none of those work. I'm expecting to be ...

model view controler in grails with out database backend?

I don't have any experience with MVC, and am trying to use Grails to write a simple web app. All the examples I've found assume you have a database to base your domain classes off of, and there for have a model based on a database. I'm getting data through an API that does socket communication, and would want the model to be based on tha...

Using grails to connect to a flex web service...

I have a grails application that will be rendering an html page into a pdf file and I have a flex application sitting on a server that is going to accept REST parameters and construct a graph based on the parameters (which will be formatted in JSON). What I want to do is make a call to the flex app with my parameters and have the flex ap...

Grails: Javascript files in views folder

Hi all, I'd like to split my views in Grails into 2 files a .gsp file and a .js file so that I get a cleaner Javascript separation from my views. So here's an example: views/index.gsp views/index.js views/home/index.jsp views/home/index.js But when I simply add the index.js script reference like this: <script src="index.js" type="te...

Validation errors not rendered in the view

I'm having a hard time figuring this validation problem. I have one parent domain class defined as follows: class Person { String fullName List telephones = [] static hasMany = [telephones : Telephone] static constraints = { fullName(size:3..50, blank:false, nullable:false) } } Then a sublcass: class Sal...

Why does findAllBy* fail when using three conditions in Grails/GORM?

Consider the following usages of the Grails/GORM dynamic finder method findAllBy*: def foo1 = Foo.findAllByYear(yyyy) def foo2 = Foo.findAllByMonth(mm) def foo3 = Foo.findAllByDay(dd) def foo4 = Foo.findAllByYearAndMonth(yyyy, mm) def foo5 = Foo.findAllByYearAndDay(yyyy, dd) def foo6 = Foo.findAllByYearAndMonthAndDay(yyyy, mm, dd) prin...

toString() in Grails Java Domain Class Causes

By default, grails seems to return <class name>:<id> for toString() of an Java domain object. That's not at all what I want of course, so I tried to @Override the toString() to return what I want. When I tried grails generate-all Tagtype, I got the following error: java.lang.LinkageError: loader constraint violation: loader (instance of...

Using the Spring Security plugin with Grails without the domain model

We're using Grails but with an existing model layer and DAO layer. We have an app written already in Spring MVC, using Spring for IoC and also Security. I'm trying to port the control and view over to Grails as a proof of concept. I have Grails working fine with IoC but am having some trouble getting Grails to work with Spring Securit...

code formatter for grails and Groovy?

I'm currently using a basic text editor to write my grails code. Does anyone know of a program that will automatically format code with indentation similar to indent does for C? I'd rather use a commandline program to do this but can use an IDE to format my code if that's the only option. ...

Grails validation of a list objects

I'm trying to get grails to validate the contents of a List of objects, might be easier if I show the code first: class Item { Contact recipient = new Contact() List extraRecipients = [] static hasMany = [ extraRecipients:Contact ] static constraints = {} static embedded = ['recipient'] } class Contact { Str...

Saving associated domain classes in Grails

I'm struggling to get association right on Grails. Let's say I have two domain classes: class Engine { String name int numberOfCylinders = 4 static constraints = { name(blank:false, nullable:false) numberOfCylinders(range:4..8) } } class Car { int year String brand Engine engine = new Engine(...

Are static functions isolated in JSP/Grails applications under tomcat?

I'm using some legacy java code that consists of several static classes from with in a Grails app under tomcat. When I only have one user using the web application everything works fine. When two users use the application things start to go wrong. I believe it's because the static classes maintain resource locks such as sockets. Am I cor...

Override grails.serverURL and application specific grails.propname settings in application.properties file

I need to override grails.serverURL at runtime WITHOUT having to regenerate the application WAR file. I have tried various ways of setting the grails.serverURL in the application.properties file and cannot get it to work. Here is the environment specific portion of the Config.groovy: environments { prod { grails.serverURL...