grails

How to redirect from a controller using a named URL mapping?

I have a URL mapping as below: static mappings = { name register: "/register" { controller = "account" action = "createuser" } } and I want to redirect using this mapping from a controller with something like: redirect mapping:'register' Unfortunately, unlike createLink tag lib, it seems that...

how to get an arbitrary file from an HTTP request in grails

I am trying to set up a web service in grails that can accept a file. How do I get the file from the request? I am testing this with something like curl -d somefile.tar http://localhost:8080/MyWebS/fileWS and my method looks like the following: def index = { switch(request.method){ case "POST": render "Ingesting file\n...

jQuery and Grails/HTML - Make text field complete text like Google does

Hello: I wanna make certain fields in my page to show me like a list of possible finishing sentences just like Google does. I think this is done via jQuery, but I'm not sure. The textfield is named commodity. Let's say I write General and in the list, array, or DB I have General Commodity I should show me General Commodity under the ...

How to Call grails webservice from C#

I have a grails webservice that takes a binary file as a parameter. This is basically what it looks like: def index = { switch(request.method){ case "POST": def uploadedFile = request.getFile('file') File f=new File('c:/dev/newfile.tar'); uploadedFile.transferTo(f); //do something with f break } } In or...

How to authenticate to webservice with curl?

I am trying to get curl to run a webservice for a site I am working with. The site requires a login. I tried using --user:password with curl, but to no avail. How do I find out how to authenticate with the site? ...

Can I run grails integration & functional tests against a running server?

I'm finding the feedback look pretty slow when running integration and functional tests in Grails. Is there a way I can run them against a running server instance while I'm writing the tests, to save on server startup time each time they're executed? Thanks. ...

Grails interferes with jquery-tmpl syntax

The jQuery templates plug-in uses ${foo} syntax (example in jquery.tmpl doc): $.tmpl( "<li>${Name}</li>", myData ) But Grails also uses it (example in Grails doc): <body> Hello ${params.name} </body> So when I include $.tmpl( "<li>${Name}</li>", myData ) in my .gsp, Grails renders it as $.tmpl( "<li></li>", myData );. Is there a...

curl + jsecurity authentication

I have a grails app that is using jsecurity plugin for authentication. How do I use curl to send my credentials? If I just do curl -u username mysite I get a prompt for a password, then nothing. I tried to do an anyauth command and this is what I got for the site. Any idea why it is returning a 302? dcole@DCOLE-L /cygdrive/c/dev $ cu...

Spring Security is redirecting to localhost on production server

I have a grails application with the spring-security-core plugin installed. Everything works fine locally. I deployed to a staging server and everything worked fine. I deployed to our production server which is a mirror of our staging server. I can get to unprotected pages just fine. But when Spring Security kicks in and tries to do...

Grails 1.3.5 and Spring Security Core

Hi, I have build a grails application, which on login redirects users to different URLs based on User's role (custom roles defined in roles domain). Now I am trying to integrate Spring Security Core Grails Plugin to the application, so plan to use the plugin's domain model. I understand the auth action in LoginController does the user...

Grails: Groovy error reported on tomcat plugin after creating a new project

Hi, I am using SpringSource Tool Suite Version: 2.3.3.CI-R5608-B54 Build Id: 201008210801 with Java 1.6.0.u21 & Grails 1.3.5 I created a new grails plugin project and after the process was completed, STS reported problem as below. I had this problem before when creating grails project but usually got fixed if I do grails clean or p...

Bash loop ends unexpectedly looping without showing why

I have a bash script with a code like this: echo "EXECUTING TASK 1" sort -r scripts/sh/test-list | while read fn; do sh -vx scripts/sh/test-web-task.sh "$fn" done echo "EXECUTING TASK 2" sort -r scripts/sh/test-unit-list | while read fn; do sh -vx scripts/sh/test-unit-task.sh "$fn" done In test-web-task and test-unit-t...

Grails / Spring Security - not working with URL rewriting (JSESSIONID)

We have a Grails app using Spring Security and are using the method-level annotations for access control. We're just started using the PDF plugin to render pages that have both text and images retrieved from a call to a secure method. The resulting PDF doesn't show the images because the access is being rejected by the controller (pr...

Grails: How to make a g:textfield autocomplete??

I have a g:textfield, and I want to write something and then show me all the options possible that start with the same letter. I understand that is called AutoComplete. Maybe using jQuery or JavaScript?? Any ideas?? Thanks in advance! ...

Did someone happen to see maven archetype for Grails+GWT project?

and if yes, where? Thanks for any help ...

Grails: How do I print in the cmd console??

I wanna print a few values in the console, how do I do this? Every time I get into a function, I want it to print a line with whatever text, I just wanna know if I'm getting into the function, and for some if-else statements. Mostly for debugging. ...

Grails: How do I make my list a MS Excel file??

Hello: My list.gsp is divided into two, the top part is like a search filter, and the bottom part is the regular list that is provided by Grails I have a template _list.gsp in my list.gsp. And I wanna create a button to make that _list.gsp template a MS Excel file. But I want only the template to be on the Excel file. Not the rest of t...

Deleting m-to-m is also trying to cascade delete a one-2-one

I have the following Domains class Committee { String name BoardCommitteeType boardCommitteeType Date dateCreated Date lastUpdated User createdBy User modifiedBy static belongsTo = [ board: Board, ] static hasMany = [ members: User ] } class User { static hasMany = [ ...

Grails how to access a variable from javascript

Hi I have a grails variable which is of type JASONList that is rendered in a template Is there a way to access this list from inside a javascript function. Lets say I want onresize to fit all the objects on the screen. Without making a db call and re fetching the entire list from ajax .... Lets say the template does something like ...

GORM createCriteria and list do not return the same results : what can I do?

I am using Nimble and Shiro for my security frameworks and I've just come accross a GORM bug. Indeed : User.createCriteria().list { maxResults 10 } returns 10 users whereas User.list(max: 10) returns 9 users ! After further investigations, I found out that createCriteria returns twice the same user (admin) because admin has 2...