grails

Compiled and signed grails plug-in

Is it possible to compile and sign grails plug-in? I am thinking about distributing my application logic using grails plug-in architecture and I do not want my client to be able to read that easily .groovy or to modify it. Is it possible to package it somehow or at least distribute only compiled .class? ...

Grails how to change the current locale

Hi, How can I change the current locale ? I tried to put controller/action?lang=de but my locale is still en_US I tried to override the value using this piece of code: def key = "org.springframework.web.servlet.DispatcherServlet.LOCALE_RESOLVER" def localeResolver = request.getAttribute(key) localeResolver.setLocale(request, response...

Grails, finding available views (.gsp's) at runtime

Is there an easy way for a grails application to find the available list of views (*.gsp) available at runtime. Ideally a solution will work for both application servers which unpack the WAR and those that do not unpack the WAR. Thanks! ...

weird grails error message.

Hi, Using grails 1.1.1 I got this message when I did a modification on a service and then tried to refresh the page. I have a controller name ContributionPlanController. It has a service ContributionPlanservice. inside the ContributionPlanService, it has ProductService and some other Services including JointPIAService. JointPIAServi...

Inheritance and subflows with Spring WebFlow in grails

Spring WebFlow supports some advanced reuse features like flow inheritance and subflows. Using this features in SWF xml definitions is pretty easy, for example: <flow parent="parent"> <subflow-state id="addGuest" subflow="createGuest"> Can I use these features with weblflows in Grails? Can I define these using the SWF groovy dsl? How ...

Inject a simple map into a Grails controller

Hi, I'm trying to inject a Map into a Grails controller. I want to inject the same map into many controllers so would like to define it in resources.groovy. I've looked on the web but can't find an example of creating a simple map. In Spring MVC I've used something like this: <util:map id="diplomaPermissions"> <entry> <key>...

Watermarking images on upload

I'm creating a website which requires the images in the site's Gallery to be watermarked. I'd prefer the watermark to get added programatically when the image gets uploaded to the application (via it's web interface) than to manually add it before we do the upload. Are there any simple ways (perhaps an image library?) that will allow me...

Grails, getting InputStream from Controller (or even Servlet)

I'm trying to get inputStream from request, but it's always empty. Any idea how to get the contents of it? I'm trying to make a DataInputStream from it. ...

Redirect user in Grails if browsing an action

I have a Grails controller action that is used for Ajax purposes, though you can still navigate and view the page in the browser. class QuoteController { def quoteService /** * This page uses the ajaxRandom function defined below to display random quotes. */ def random = { def randomQuote = quoteService.getRandomQuote() [q...

Service method or domain static method in Grails?

Hi, This is a design question : when do I need to create/use a static method (in a domain class for instance) and when do I need to create/use a service instead? What is the difference between them ? Thank you. ...

How to call a Grails service in a view?

Simple question : I have a service class (let's say helpersService) and a method def constructURI(params). How can I call this method from a template view. I have tried the following code without success <% def helpersService = new HelpersService() // or def helpersService %> <img src="${helpersService. constructURI(params)}"/> But ...

Eliminate Add and Delete functions for one class in Grails application

I have an application with numerous Controllers. Of those, I have one that I want Update only capability, no Add and Delete functions. I've added the redirects to the class Controller for the Create and Delete, but I want to prevent the Delete and Add buttons from appearing on the different views; list, show, edit. I need full CRUD ca...

Clashes between two Grails plugins

I've had an issue between two different Grails plugins (Drools 0.3 and WebTest) where they both seem to include some version of xml-api-* and these seem to not be able to co-exist. What's the best way to resolve these kinds of problems? ...

What CSS tools (framework,grids system, IDE,..) do I need for starting web design?

Hi, I am building a new WebSite based on Grails technology. Concerning the graphical design of my website, I plan to use services from a professional web designer but meanwhile, I need to do some basics graphical design myself in order to have a "user-friendly" beta-version. I have read through the stackoverflow.com site but couldn't...

Grails Application context

Hi! I have a grails / groovy application running under tomcat. For some reason I have to be able to change the application context dynamically. That is, I want to be able (at login time) to set this context. I know that this is doable via the Config.groovy but this is static. At login time I am getting a parameter which is the context...

Eat, Sleep and Breathe Unit Testing/TDD/BDD

I do write unit tests while writing APIs and core functionalities. But I want to be the cool fanboy who eats, sleeps and breathes TDD and BDD. What's the best way to get started with TDD/BDD the right way? Any books, resources, frameworks, best practices? My environment is Java backend with Grails frontend, integrated with several exter...

Missing taglib when using GroovyPagesTemplateEngine

G'day all, I've been processing dynamic GSP content via tags in my own taglib which works just fine using code like: def GroovyPagesTemplateEngine groovyPagesTemplateEngine ... def processGSPContent(model, name, out) { log.debug("model is $model") Template t = groovyPagesTemplateEngine.createTemplate(model.conte...

Grails, Nimble and Blogito

Hi, I tried to run the sample application of Nimble 0.2 (blogito) downloaded here : http://github.com/intient/blogito but unfortunately I got stuck with 2 major issues: When running grails run-app, I got 2 times out of 3 the following error : 2009-10-24 14:38:15,198 [main] ERROR context.ContextLoader - Context initialization faile...

Hudson build fails with Git repository & Grails

I recently configured Hudson to build a Grails project using Git as the repository. However, I am getting this error when running the build: Compilation error: srcdir "/home/matthew/.hudson/jobs/qotd-idea/workspace/src/groovy" does not exist This is because src/groovy is not copied into the Hudson workspace, so Hudson can't find the ...

Integration tests failing in Grails & App Engine

I am using Grails with the App Engine plugin and JPA persistence. When running grails test-app my unit tests run perfectly, but I receive the error below when the integration tests start. Is this a known issue with the app-engine plugin? Starting integration tests ... [copy] Copying 1 file to /home/matthew/.grails/1.1.1/p...