I'm trying to create a very simple relationship between two objects. Can anybody explain me why I can't find the Company object via findBy method?
class Company {
String name
String desc
City city
static constraints = {
city(unique: true)
}
}
class City {
String name
static constraints = {
}
}
cla...
Hi all,
I'm implementing a web service on the xfire plugin.
I was wondering how I'm supposed to handle the errors.
I tried with this setup but the error is not returned to the SOAP client:
GaSession[] myMethod( String userId ) throws MyException{
GaUser user = GaUser.findByUserId( userId )
if (!user) throw new MyException("user...
I've been experimenting with Grails for the past two days and, so far, I'm really happy with it.
Coming from Rails, the only thing I've really been missing here is the dev-mode debug information shown after the page has been served.
This is what I mean:
Processing UsersController#show (for 127.0.0.1 at 2010-06-14 10:28:44) [GET]
Par...
I am creating an application with google app engine and grails. I have a Controller set up for my Flex application to call. The Controller calls a service to get a list back and send it back to Flex.
The Flex client is able to get the data back one time. Also If I call the action in the browser I can call the action and get data back as...
I'm using Netbeans to build a Grails app, while I have used this fine before on this new computer I can not get even the basic project to compile and run. I am getting errors around compiling the Tomcat plugin. If I uninstall the plugin it and use Jetty instead it will compile but the project isn't set up for Jetty and is missing files.
...
is there a way to have hibernate use auto generated ids if it wasn't assigned but use the assigned value if it was?
...
Have someone there any experience with integrating Tiles into Grails (instead of SiteMesh)?
I found a few articles like this: http://devdevdev.wordpress.com/2009/01/ and as i understand at least one year ago there was no way to use Tiles inside Grails. Maybe something changed last time? Has anyone tried to do it?
ps. or maybe there ar...
I googled a lot but i find crap documentation about jpa.
I had to implement a domain model like cat and dog inherit from animal, and animal has a one to many and a many to many relation.
How to do that?
...
Hi all,
in my Grails app I have a couple of simple security filters (please note it's just a prototype, not a commercial app:
securityCheckFilter(controller:'overview', invert:true) {
before = {
if(!session?.gaSession?.gaUser) {
flash.message = "You are not authorised to see this page. Ple...
I'm currently using Java & Spring (MVC) to create a webapp, and I'm considering moving to Grails. I'd appreciate feedback/insight on the following:
I have multiple application contexts in the current Java/Spring webapp that I load through the web.xml ContextLoaderListener; is it possible to have multiple application contexts in Grails?...
The following is a basic log4j configuration inside Config.groovy using the log4j DSL with Grails 1.2, it works as expected (log all errors to the given file):
log4j = {
appenders {
file name:'file', file:"c:/error.log"
}
error 'grails.app'
root {
error 'file'
}
}
How would one translate this into...
Basically, I want to be able to assign objects created within filters to members in a base controller from which every controller extends. Any possible way to do that?
Here's how I tried, but haven't got to make it work.
What I'm trying to achieve is to have all my controllers extend a base controller. The base controller's constructor...
Hello,
i want to use Enum to represent some selection values. In /src/groovy folder, under the package com.test, I created the Enum.
package com.test
public enum TabSelectorEnum {
A(1), B(2)
private final int value
public int value() {return value}
}
Now, I am trying to access it from controller like
TabSelectorEnum.B.va...
Hello there, this is a problem I'm currently facing :
I've made a
<select id="nationalityArea.id" tabindex="6" name="nationalityArea.id">
<option value="null"></option>
<option value="619">Îles Cook</option>
<option value="646">Îles Féroé</option>
<option value="625">Îles Salomon</option>
<option value="598">Îles Vierges Américaines</...
I am currently picking up Grails and Roo to expand my skills and to have a bit of fun.
The vast majority of training materials appear aimed at new developers or Java developers.
Does anyone know of any guides, resources or have any tips and anecdotes for translating existing development experience with .Net (C#/ASP.Net/Asp.Net MVC)?
...
I've developed a simple webflow in Grails (mostly to experiment with using webflows- its a bit overkill for this case). After some trials and tribulations with Serializable objects, I have it working - sometimes.
Here's the rub- the first time I access the webflow after starting the app (run-app), I get this exception:
2010-06-16 09:1...
Hi,
I'm doing Grails To Action sample for chapter one. Every was just fine until I started to work with Services. When I run the app I have the following error:
groovy.lang.MissingPropertyException: No such property: quoteService for class: qotd.QuoteController
at qotd.QuoteController$_closure3.doCall(QuoteController.groovy:14)
at qo...
I have a domain object called page that only has a title, I then have subclasses what are StaticPage that also has a textblock and PicturePage that contains a url. I have a site object that has many pages, I am looking for a way in the view for the site to call the a different template for each subclass. I can easily iterate through the ...
Recently, I'm trying to migrating my application from CakePHP to Grails. So far it's been a smooth sailing, everything I can do with CakePHP, I can do it with much less code in Grails. However, I have one question :
In CakePHP, there's an URL Prefix feature that enables you to give prefix to a certain action url, for example, if I have ...
I have a CSV file with a list of "banned usernames" --it's about 10,000 names. Basically I want to check against this list upon user registration. I'd like to load this list in my database but I'd rather not create a domain object for each name and BootStrap them. However, I'd also like to stay within the Grails framework as far as manag...