grails

Grails Delete and Cascading

I have the following 3 classes class User { static hasMany = [coupons: Coupon] } class Coupon { static belongsTo = [affiliate: Affiliate] } class Affiliate { static hasMany = [coupons: Coupon] } How do I setup cascading so that I can delete a specific Coupon and it will be removed from the lists in Affiliate and User. I keep gett...

Application not loading when deploying on production and running in IE6

My application is using grail . locally on all browser it is running . but on production in IE6 and firefox 1.5x it is not loading . I am not finding why it is behaving like this way? ...

Grails Google Maps - Render map as index it can't pick up the places saved in db

Hi, I have successfully followed the Google Maps example at IBM DeveloperWorks. The map is currently located at: localhost:8080/myapp/trip/map and I want to move the map to be as the index page, localhost:8080/myapp. I can easily render the map if I replace the code in index.gsp, but the points in the db are missing. It seems that the ...

Reading objects from database after a service method rollback

Hi all I have a grails service that is persisting some changes. If I rollback the transaction in the service class, throwing a RuntimeException, and later (in the same request) I try to re-read any data, I'm getting the following exception: ERROR hibernate.LazyInitializationException - failed to lazily initialize a collection of role:...

printing groovy nodechild values

I want to print my xml which is coming from an external feed on the console. When I do log.debug "${xml}" I get xml values on the console but not the starting and end tags. For example <fruits> <fruit1>apple</fruit1> <fruit2>orange</fruit2> </fruits> Just prints appleorange Just the values concatenated one after other...

Problem with grails email confirmation plug-in only with run-war

I'm using the email-confirmation plug-in and it's working fine when using run-app. However if I run-war, it gives me the following error upon confirmation sendout: [...] No signature of method: com.grailsrocks.emailconfirmation.PendingEmailConfirmation.save() [...] After further trying, it seems that this even happens only with certai...

Problem with encode slash in url

Hi gurus I have problem with encode slash in url. Problem: from request in GSP page: <a href="http://foo.cz/myapp/page/show?url=home/gallery"&gt;Gallery&lt;/a&gt; I got: http://foo.cz/myapp/page/show?url=home%2Fgallery in address row in Internet browser. Problem is with encode character from "/" to "%2F". Explanation: this is link ...

How to take a delimited list, parse it, and add it to list.

Hi, I'm using Groovy and Grails and am trying to take a parameter passed to a controller, parse it, and add each individual element into a list. I thought this would work, but it is adding the whole string into the list, leaving me with only one element. list = [] list.add(params["firstNames"].split()) is returning a list with size ...

Moving from Groovy to Java

In my grails project I'm moving all calculations to java classes. Here is the link to source code (i've saved it in Google Docs). Main purpose is to format current time into string(in two languages). Examples: 1 day 2 hours 3 seconds 1 день 2 часа 3 секунды But i have one method: private static boolean endsWith(final long num, fin...

best way to implement diferents views of a same webpage depending on certains attributes in grails

I would like to have diferent views of a webpage depending on certains attributes of an item that I am showing. This is: if the item is in the category X then I show some sections of the page. In other category I show others. There is others attributes of the item. I am aware of the multitenant plugin, but I think that is not what I a...

Cache per request in grails

I want to cache an dto, that I get consuming an api, in the whole request. I try to access the request variable in a service, but it don't work. Also I had tried to create a service with request scope but it has a error in bean creation stage in spring. Some thing like this: http://jira.codehaus.org/browse/GRAILS-4148 Can you give me ...

Grails debugging flash scope

I am using Authentication plugin for Grails. It needs a flash variable to be set to do redirection after successful login. I set the flash variable in various places in controller, in view just before authentication service does it's work, but somehow flash variables are being cleared on the way. I can't manage to find a way to spot th...

When running a unit test on the controller save method, for some reason a grails models save method returns simply null.

So we have a unit test which is failing where we attempt to call the save method on a model. This for some reason returns true when we run the method in reality. We've mocked the domain in the setUp method. Does anyone know why the heck the save method is returning null? Source Code here: http://gist.github.com/485365 We're running Gr...

REST URL mappings not working (Grails 1.3.3, Tomcat6)

I'm new to Grails (but not to Groovy or web development). I'm trying to write a web app that accepts REST requests. The problem I have is that despite following - as far as I can tell - the documentation, I still receive 404s when hitting what I believe is the correct URL. The details are as follows. The project is brand-new (using G...

GroovyWS and complex requests

Hello Comrades, I've faced with a problem of sending complex requests with GroovyWS. This is sample request generated by soapUI: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dex="http://www.temp.com/com/dex" > <soapenv:Header/> <soapenv:Body> <dex:executeRequest> <!--Optional:--...

Looping to create dynamic SQL string...

I am working on a problem that will use certain fields to return a unique row. The amount of fields could be 2 or 20, so I need to dynamically generate a SQL string based on the list of key fields and their values. The SQL will look something like this: Select count(data_cd) from dev_util.t_generic_repository AS ... This is where ...

Rendering a GSP from a Quartz job in Grails

I have a quartz job that needs to render a GSP, when I tried: def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib() def text = g.render(template: "/templates/myTemplate", model: [language: language, product: product]) I received the following exception: org.quartz.JobExecutionExcept...

Grails and Amazon SimpleDB

How to setup Grails project to use Amazon SimpleDB? One possibility is to install gorm-jpa plugin and use SimpleJPA library, but I couldn't setup it correctly. Has someone experience with this combination? ...

How do I test the URL mapping for a grails web service

I'd like to test the URL Mappings for a simple REST web service that I'm setting up in Grails. The problem is that the URL mappings are defined with the HTTP method: class UrlMappings { static mappings = { "/blah/$city/$date"(controller:"blah"){ action = [GET:"show", PUT:"update", POST:"save"] } } } ...

How do I enable MTOM on the server side for a Web Service published using Grails with CXF?

Using Grails and CXF, I have published a small web service that looks like this class TestService { static expose=['cxf'] int pushData(int id, DataHandler data) { //receives data for a specific ID, return 1 } } The thing is that I now would like to enable MTOM for the transfer of the DataHandler-data. No...