grails

Is there a way to call server side Groovy object method from client side JavaScript code via AJAX?

There is DWR which satisfies my needs in Java. I'm interested if there is any Groovier way to do the same thing - with convention over configuration, dynamic method invokation, etc. ...

Google search in grails application

I am creating one web application in GRAILS framework.In that I want to implement google search feature.Can we implement this feature? If we can, How to implement this feature in grails application? Can anyone provide help on this? Thanks... ...

grails base.dir system property

I have a simple grails file upload app. I am using transeferTo to save the file to the file system. To get the base path in my controller I am using def basePath = System.properties['base.dir'] // HERE IS HOW I GET IT println "Getting new file" println "copying file to "+basePath+"/files" def f = request.getF...

Grails/Hibernate Database crashes under load: Unable to connect (even when pooling)

I have an application in Grails. I use Hibernate to access the database (per standard grails rules) I use MySql and the site works and is stable (for 6 months). I am doing load testing, and recently discovered that the database rejects connections when under load. Using MySQL Server 5, I can see threads connected hovering around 20. Th...

Grails: checkbox not being set back to false

I am developing a Grails (1.0.4) app where I want to edit a collection of collections on a single page in a grid view. I got it to work quite well depending only on the indexed parameter handling of Spring MVC, except for one thing: boolean (or, for that matter, Boolean) values in the grid can be set via checkbox, but not unset, i.e. w...

Grails: Accessing spring beans in the destory closure of Bootstrap code?

Hello, I'm looking to access a bean in my destroy closure in the Bootstrap.groovy of my grails project. Any ideas on how to achieve this? I seem to have no access to servletContext...? ...

username availability checking using ajax in GRAILS

I am doing one web application in grails.Now I am making signup page.In signup page I want to check the username availability via ajax.I can write the code for username availability checking in controller or service.I struck with how to contact server from client side via ajax. My sample gsp code is <g:form method="post" action="signu...

Project integration in Grails

I am doing a few tutorials and done some demo applications in Grails. Suppose I have more than one project made in Grails and I want to integrate all these projects in to a single application, how do I do it? For eg: I have made a 'To do list' and 'on-line examination' and now I want to create a new application that would incorporate b...

User management plugin/framework for Grails?

Is there a user-management plugin for grails? Nearly every website requires things like: Users Login/Authentication Registration (w/ email verification) Forgotten email reminders User User Profiles Are there any Grails plugins/frameworks/whatever that provide things like this as a base to build upon? I know how to build these th...

Implementation of “remember me” in a Grails application.

How do I implement a "Remember Me" function in Grails so that the user can check it and he won't have to log in again for 2 weeks? I'm using the jSecurity plugin and want to change the cookie's lifetime beyond the browser session. ...

Hibernate HQL: two levels of joins

I am new to HQL and have the following table relationships: Term has many Definitions Definition has many DefinitionProducts DefinitionProducts has one Product I want to get the list of Terms that have at least one Definition that has at least one DefinitionProduct that has a specific Product This is my best attempt (in Grails): Te...

o.errors.allErrors.each { println it } by default when failing to save a domain object

When persisting domain objects using Grails/GORM I frequently find myself wondering why a save() call fails. This can easily be solved by adding the logic: if (!o.save()) { o.errors.allErrors.each { println it } } However, adding this everywhere I do a .save() adds a lot of duplicate code. In the spirit of DRY I'd like to configu...

Grails Paging Results are Inconsistent

I'm doing some paging in my Grails application. Since I'm doing some special sorting, I can't use the convient sort/paging methods. Here is my paging code on the server side: def criteria = ClientContact.createCriteria().createAlias("client", "c") criteria.setFirstResult(params.offset?.toInteger()) criteria.setMaxResults(params.max?.t...

Remote File upload in grails

I am creating a webapplication using grails which uses lot of ajax.I want to implement file upload using ajax.I dont know how to use ajax for file upload.My sample GSP code is : <!-- code for file upload form--> <div id="updateArea"> </div> I tried with and .After uploading I want to update the 'updateArea' with the result.In result...

Grails UrlMappings with parameter values containing "."

Given this UrlMapping: "/foo/$foobar" { controller = "foo" action = "foo" constraints { } } Combined with this controller: class FooController { def foo = { def foobar = params.foobar println "foobar=" + foobar } } And with these requests: http://localhost:8080/app/foo/example.com give the ...

Concurrency when using GORM in Grails

Let's say I have a counter function which updates a counter using raw SQL: public void updateCounter() { executeSql("UPDATE counter SET count_value = count_value + 1 WHERE id = 1;"); } The database would make sure that two concurrent calls to the counter are handled as expected - that all calls would update the counter with one i...

Spring Security Between Two Apps

I am using the Spring Source 2.0 security plugin and I've done the tutorial described on this page using the Requestmap method of security. Acegi Plugin Tutorial I now want to create a second bookstore as follows and implement the same tutorial. grails create-app bookstore2 Both apps will share the same database so all users, roles...

Grails deploy error

Grails grails-1.0.4 , TomCat 6.0.14 , Tomcat error log: SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) ...

Grails UrlMappings with URL-pattern ending with "/"

I have the following UrlMapping in my Grails UrlMappings class: "/$something/" { controller = "controllerName" action = "actionName" constraints { } } Requests to both "/foobar/" and "/foobar" gets routed to the correct controller and action. However, URL:s created using g:link does not end with slash ("/"...

How can I update Grails to 1.1 with IntelliJ IDEA 8.0.1?

I'm running IntelliJ IDEA 8.0.1 and would like to upgrade my Grails installation to Grails 1.1 which was released today (March 10, 2009). When the upgrade is complete and I try to "run-app" my application I get the error message "Grails Are Not Configured". It seems to be a known problem - but is there any work-around or fix? I'd ...