grails

Grails Database Connection Problem When Deployed

I can successfully run my Grails application in Jetty. It succeeds in connecting to my MsSql database and everything is fine. When I deploy that same application in Tomcat 6 on the same machine, I receive the following error on startup in the Tomcat log: Caused by: java.net.ConnectException: Connection refused: connect I don't belie...

Displaying images in gsp(grails)

I am very new to grails.I am doing one sample project for image uploading and displaying.Right now my project uploads the images and stores into the images directory.Now i want to display all the images stored in the "image" directory. I dont know how to write the gsp code for display all images. For displaying the images I wrote the fo...

Image resize in Grails

I am developing a Web Album using Grails and for image processing, I am using grails-image-tools plugin. I need a functionality to resize the images if the uploaded images size is too big (for eg: more than 600 * 840 ) . In this case I need to resize this image to 600 * 840). What is the most efficient way to do this? Thanks a lot. ...

image uploading in grails

hi, I am new to grails.I am doing web application that uploads the image from client side and it stores that in server. My Gsp code is: <g:uploadForm action="saveImage"> <input type="file" name="image"> <input type="submit" value="Submit"> </g:uploadForm> My saveImage action in controller is: def saveImage={ def file = request.get...

Groovy/Grails SimpleTemplateEngine Freezes

I'm using Grails to send a large number of HTML emails. I use the SimpleTemplateEngine to create my email bodies in this fashion: def ccIdToEmailMap = [:] def emailTemplateFile = Utilities.retrieveFile("email${File.separator}emailTemplate.gtpl") def engine = new SimpleTemplateEngine() def clientContacts = ClientContact.list() for(...

Grails and multiple databases (one per host)?

Is there a way (in Grails) to change the 'primary' database while the application is running, but before any domain objects have been instantiated? I'm trying to set up an app where each customer has their own database, but don't want to have to run a separate Java interpreter for every single customer. ...

Grails MySQL MaxPoolSize

How do I increase the maxPoolSize in Grails when using mysql? It appears to be using a default connection pool only 8 connections. ...

How do I handle Security between two Grails apps?

If I have two separate Grails apps running on the same app server (Tomcat/Glassfish), how do I allow the user to log into the first app then have him authenticated for the second app so he's not prompted when he goes to that app? ...

Grails getSomething(int i) method doesn't compile

Can someone tell me why this Grails domain class will not compile (at runtime)? class Person { String name String getSomething(int i) { } } I get this error when I run with grails run-app: 2008-12-27 15:26:33.955::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@187e184{/asrs2,C:\Steve\asrs2/web-ap...

Reference Groovy domain class from Java class using Eclipse?

How can I reference a Groovy domain class from Java class using Eclipse? I've put my domain class in package: package com.me.myproject public class Person { String name int age } Then in my Java class I attempt to reference com.me.myproject.Person. This works for grails run-app (command line) but not Eclipse. Eclipse can't re...

After grails clean I can't run-app

I did a grails clean and afterwards when I run via grails run-app the app never starts and the following is repeatedly displayed (goes on forever, stuck in some kind of loop). I'm running Grails 1.0.4, Java 1.6 on Windows XP. Grails is somehow stuck in an invalid configuration. Any idea how to restore it? [groovyc] Compiling 3 sourc...

In Grails, need to define a Set for one-to-many relationship?

I have the Grails domain classes Child and Toy. A child can have many toys. class Child { static hasMany = [ toys : Toy ] String name } class Toy { static belongsTo = [ owner : Child ] String name } It was my understanding that there will be a toys property on Child. That is, there will be the Child method: public Se...

Grails File Download

Hi there, I'm trying to craete a site which allows users to upload any file type they like. I've implemented this feature fine, and the file is held on the server. Later on they can download the file to view, but i'm having trouble getting it to work. I've used any examples I can get hold of but they all tend to use text files as examp...

How to reference a Grails domain class fields from outside of the Grails controller and view?

I have the domain classes: class Child { static hasMany = [ toys : Toy ] String name Set toys } class Toy { static belongsTo = [ owner : Child ] String name } In my JSP I reference a child by: child = Child.findByName("Joe") or child = Child.findById(123) But when I attempt to access its fields: child.getTo...

Grails eager fetch doesn't retrieve all data

I have the domain classes: class Person { static hasMany = [ items: Item ] static fetchMode = [ items: 'eager' ] String name Set items } class Item { static belongsTo = [ owner: Person ] String name } If I leave static fetchMode = [ items: 'eager' ] in place, then calling getItems() only returns about 10% of t...

Is Grails worth it?

This is half rant, half question. Is it worth using Grails? I'm trying to develop a relatively simple database drive web applications. My expertise is in Java so naturally Grails seemed like a good choice. At first I thought of using Spring, JPA and Hibernate, but having used that previously I've ran into all sorts of tedious configurat...

Grails renders JSP as blank page

I have a Grails application with a JSP page (I'm porting a legacy JSP application). For some reason, the page renders completely blank. Looking at the HTTP headers I see it's 200 with a content length of 0. HTTP/1.1 200 OK Content-Language: en-US Content-Type: text/html; charset=iso-8859-1 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cook...

Paned components in GSP

So it looks like Grails' GSP does not have an include tag (correct me if I'm wrong). The closest thing to "include" is to use the render tag. There is also the include plugin. In my case, I have a classic top-left-middle-right-bottom paned page. The top header or left side would include navigation. The middle would be the content. The r...

Grails NumberFormatException on stylesheet

Using Grails 1.1 beta2 and a JSP page. The JSP includes the CSS reference: <link rel="stylesheet" type="text/css" href="styles.css"> When this line is included Grails pukes with the error: [7000] errors.GrailsExceptionResolver java.lang.NumberFormatException: For input string: "styles" org.codehaus.groovy.runtime.InvokerInvocationExc...

Dreamweaver + Grails

Has anybody tried doing GSP design with Adobe Dreamweaver CS4? It has support for JSPs, but it doesn't recognize the gsp extension, and even if it did I think there would be problems regarding the gsp tags that it would not recognize. I found a little cookbook here (http://www.bitwalker.nl/blog/using-groovyserver-pages-in-dreamweaver) fo...