grails

grails + app-engine upload error

I am using grails 1.3.3 and app-engine plugin 0.8.10; my test case is: upload.gsp: <form action="/test/process" method="post" enctype="multipart/form-data"> <input type="file" name="file"/> <input type="submit"/> </form> TestController has: def process = { println request.getFile("file").inputStream.text } First time...

Is Grails a viable option for large scale enterprise web apps?

Coming from a J2EE dev background, I love the idea of Grails....all the benefits of using enterprise Java (Spring, Hibernate, etc. ), but with the simplicity of Rails (scaffolding, convention over configuration, Groovy scripting, etc.). My company is considering rolling out a new enterprise scale web application built on top of Grails. I...

Configuring Grails to use own DataSource implementation or to proxy the standard DataSource

In an application I want to use my own implementation of javax.sql.DataSource that extends the standard org.apache.commons.dbcp.BasicDataSource used by Grails and adds the functionality to set the client identifier based on the currently logged in user at the Grails application. What is the best way to change the underlying javax.sql.Da...

How to specify JAR dependencies in Grails BuildConfig.groovy?

I am getting the following error when trying to deploy a WAR file (MIPS.war) onto a target environment: INFO: Deploying web application archive MIPS.war 2010-08-04 12:44:56,977 [main] ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'plugi...

Grails 1.3.3 and Functional Test plugin 1.2.7 issues

Has anyone had any trouble getting Functional Test plugin working in Grails 1.3.3? I've used it in previous projects with no problem, but just tried installing it into my latest project with no luck. Installation seems to go fine. Running the script: grails create-functional-test XXXXX results in no test file. Here's the output: ...

Security Configuration for Tomcat using Virtual Hosts and Aliases

We have a grails app that uses two domain names and Tomcat was configured to use Virtual hosts and Aliases. Here's the server.xml snippet: <Host name="domain1.com" appBase="myApp" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Alias>domain2.com</Alias> </Host> We also wanted ...

What is the best database to use with Grails in an enterprise application?

I realize this has flame potential, please refrain. That being said, I'm interested in what databases people have used with Grails. What positive experiences and what horror stories are out there? I love MySQL, but there are a few significant bugs that are impacting me between Hibernate and MySQL, particularly as it pertains to index cr...

Lazy Loading Many side, and contains() comparison

We have a couple of domains something like the following: class Interceptor { static hasMany = [positions:Position] } class User { static hasMany = [positions:Position] } There is a procedure in our application where we are looping over a set of Users and we need to see if the User contains a position based on the Interceptor...

Transferring data from one grails action to another

For our grails application, I've written a method that lets you upload a CSV file full of contacts, and it will parse the file and create contacts out of the data. I've used a test file of my own (hard-coding which fields mean what) and it works great. But of course I can't leave the field references hard-coded like that, so my next ste...

grails and mysql batch processing

I'm trying to implement the advice found in this great blog post for batch processing in grails with MySQL. The problem that I'm having is that inclusion of periodic calls to session.clear() in my loop causes org.hibernate.LazyInitializationException's to be thrown. There's a quote down in the comments section of the page: You’re sec...

Grails - how to enforce at least one in a one to many relationship

Hi, Please can you help with the example below: class Car { static hasMany = [cd:Cd, fluffyDice:FluffyDice, wheel:Wheel] } class Wheel{ static belongsTo = [car:Car] } How do I enforce that a car has at least one wheel? ...

How to retrieve error message from an AJAX error callback in Grails ?

I am sending the following AJAX request : $.ajax({ type: 'POST', data: $(this).parents('form:first').serialize(), url:'/myapp/comment/saveOrUpdate', success: function(data,textStatus) {insertNewComment(data)}, error: function(xhr, textStatus, errorThrown) {alert(xhr.responseText);} }) ...and my controller action looks like this ...

How can I externalize a custom constraint in Grails?

I'd like to keep my custom constraint validator closures outside of the constraints definition for my attribute because it makes it easier to read and reuse, but I'm doing something wrong. I'm trying to do this: class City { String name static constraints = { name( nullable:false, blank:false, validator: uniqueCityValid...

Is there a 'not in' equivalent in GORM?

Is this possible to convert in createCriteria()? SELECT * FROM node WHERE (node.type = 'act' AND nid NOT IN (SELECT nid FROM snbr_act_community)) LIMIT 10 I know there's a 'in' operator and here's what I have so far: def c = VolunteerOpportunity.createCriteria() def matchingActs = c.list { node { eq('type', 'act') } ...

Grails Spring Security (Acegi) plugin intercept login to inject custom Facebook Connect logic

Ok, second try here.. hoping I phrase my question better to get a few responses. I am currently working on a small project developed in Grails with the Spring Security plugin to handle account management and security. I want to intercept the login function and add some custom code. The goal is to have 2 options available to the end ...

one to many relation on appengine with Grails/GORM

Hi, does anyone know how to handle a "one to many" relationship with Grails/GORM on the google appengine? I do understand how relationships get handled with Gorm, and there is also a good series of articles about it: http://blog.springsource.com/2010/06/23/gorm-gotchas-part-1/ http://blog.springsource.com/2010/07/02/gorm-gotchas-part-...

grails console execution error

Hello, Environment Grails 1.2.2 Ubuntu 9.10 IntelliJ 9.0.3 Everything works fine in IntelliJ. When I execute "grails console" in the project root I get the following Error executing script Console: groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not...

DO I need to create a custom authentication provider for facebook connect + spring security in grails?

Do I need to write a custom authentication provider to use facebook connect with account registration + authorization for the Spring Security plugin in Grails? I am trying to offer the traditional application registration with facebook connect in a grails dev app using Spring Security. Does this make sense? Any ideas? ...

Appropriate use of Grails, Rails, etc?

We've got an Excel spreadsheet floating around right now (globally) at my company to capture various pieces of information about each countries technology usage. The problem is that it goes out, gets changes, but they're never obvious, and often conflicting - and then we have to smash them together. To me, the workbook is no more than a ...

Redirect to controller with multiple parameters on Grails

Hi All, I am developing a web app in Grails and I need to redirect my current page to another controller, passing to it multiple parameters. The exact scenario will be to have a from with multiple SELECT menus and have on them all a call to this controller on their "onChange" property, passing to it the current value of all the SELECT ...