1
голосов
2ответов
2222 просмотров

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.

4
голосов
5ответов
1621 просмотров

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 (per...

3
голосов
2ответов
2989 просмотров

Inject a simple map into a Grails controller

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="dip...

2
голосов
1ответов
1366 просмотров

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 Gra...

3
голосов
1ответов
3208 просмотров

weird grails error message

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 incl...

2
голосов
1ответов
618 просмотров

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!

22
голосов
6ответов
25262 просмотров

Grails how to change the current locale

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) loca...

0
голосов
3ответов
106 просмотров

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 ...

1
голосов
4ответов
1359 просмотров

Installing Nimble for Grails

I came across Nimble yesterday, but couldn't get past Step 1, configuring BuildConfig.groovy to find the Nimble's remote repository. My BuildConfig.groovy file is one line: grails.plugin.repos.discovery.intient="http://intient.com/downloads/grails/ Here is the message I get when running gr...

4
голосов
10ответов
1069 просмотров

I want to make a "Web 2.0" application without using JavaScript directly

I'm a full time Java developer of around 4 years, professionally. I'm a GWT fanatic. I love Java. Here's the problem: In my free time I often fall victim to the verbosity of my favorite tools for doing "heavy" development. I also often fall into the trap of obsessively engineering my softwar...

0
голосов
1ответов
2560 просмотров

Problem with JSON in Grails

Im toying with grails but i'm having troubles when render JSON in the controller, i have this code import grails.converters.* class CourseController { def index = { redirect(action:list,params:params) } // the delete, save and update actions only accept POST requests ...

5
голосов
2ответов
2747 просмотров

In Grails, how do I declare a SQL Server Schema name for a Domain Class?

I have recently started reading up on Grails and would like to use SQL Server security schemas to group tables generated by GORM. However, I cannot seem to find a reference explaining how to perform this task. I am new to Hibernate as well and would like to know if this is possible. Thank you.

1
голосов
1ответов
184 просмотров

domain design in grails for related things

using Grails 1.1.1 I have domain in Grails Person. Person can be related to another Person buut they can be stand alone. this is like: I have A as my friend and A have me as his friend B can be stand alone (not having friend) should I type Person { belongsTo = [friend:Person] hasMany =...

2
голосов
3ответов
9324 просмотров

Firefox has detected that the server is redirecting the request for this address in a way that will never complete

I'm following Scott Davis' tutorials on developing grails apps, but whenever i try to run my app (or indeed his source code) i get "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." Safari gives a similar error message as does O...

0
голосов
1ответов
1301 просмотров

Cannot render form tag using 'render' in Grails Controller

Using markup with the render is not adding the form tag. I tried this with contentType "text/html", "txt/xml" and it does not work. I have this in my controller: def myTest= { render(contentType: "text/plain") { div(id:"myDiv") { p "somess text inside the div" ...

1
голосов
2ответов
483 просмотров

Can I run grails 1.2-M3 with groovy 1.7 beta 1?

I have groovy 1.7 beta 1 in my path and GROOVY_HOME pointing to same groovy 1.7 beta 1 directory. I have installed grails 1.2-M3, and set GRAILS_HOME to point to grails 1.2-M3. I would like to try some groovy 1.7 features in my grails app, anonymous inner classes to be precise. I am receiving a...

3
голосов
1ответов
3988 просмотров

Grails unit testing help needed

I want to test a Grails controller which calls a service. I'd like to mock the service. The Service has a method: JobIF JobServiceIF.getJob(int) and JobIF has a method: String JobIF.getTitle() Here's my controller def workActivities = { JobIF job = jobService.getJob(params.id) [care...

1
голосов
1ответов
442 просмотров

How to call a WCF .net webservice by using grails

By using grails I have to consume WCF WebService.I was trying but could not.If someone could just tell me the steps to call a webservice by using grails.

2
голосов
1ответов
1631 просмотров

Hibernate transaction boundaries

I'm using Hibernate (in a Grails app) and the transactional boundaries are service methods, i.e. every time a service method is called a transaction starts, and every time a service call completes the transaction is either rolled back or committed. If one of the database operations causes a data...

2
голосов
1ответов
880 просмотров

Is the method groovy.xml.XmlUtil.serialize buggy for big xml input streaming?

When I execute the following script: mb = new groovy.xml.StreamingMarkupBuilder() mb.encoding = "UTF-8" xmlClosure = {...} //BIG XML File building (at least 300 KB) new OutputStreamWriter(new FileOutputStream(exportXmlFile), 'utf-8') << groovy.xml.XmlUtil.serialize(mb.bind(xmlClosure)) ...

2
голосов
3ответов
662 просмотров

Grails App Engine Authentication

How do I setup Account Registration, Login, etc in Grails when developing for the Google App Engine? Normally I would use the Acegi plugin but I've read that it doesn't work with Google App Engine. For reference, I'm using the Grails app-engine and gorm-jpa plugins.

6
голосов
6ответов
7629 просмотров

Triple single quote strings in Groovy - Should the resulting string contain extra spaces?

If I use the following groovy code: description: '''Join the Perl programmers of the Pork Producers of America as we hone our skills and ham it up a bit. You can show off your programming chops while trying to win a year's supply of pork ...

0
голосов
1ответов
4362 просмотров

How to convert XML file in UTF-8 using Groovy builder StreamingMarkupBuilder

Even if the question subject seems complicated, the issue is quite simple. I create an XML file with the following script: def xmlFile = new File("file-${System.currentTimeMillis()}.xml") mb = new groovy.xml.StreamingMarkupBuilder() mb.encoding = "UTF-8" new FileWriter(xmlFile) << mb.bind...

22
голосов
2ответов
24398 просмотров

Using Postgres with Grails

Has anyone gotten Grails working with Postgres? I have used this tutorial and everything seems to make sense and be correct to me. However when I 'grails run-app' I get this error Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgres://10.0.0.21/tribes' java.s...

7
голосов
2ответов
1029 просмотров

Maven + Grails + App Engine

Has anyone used Maven, Grails, and App Engine together? I can use Maven with Grails and Grails with App Engine, but using them in concert gives me the following error: The command 'grails run-app' is not supported with AppEngine. Use 'grails app-engine' to start the application Is there an...

4
голосов
3ответов
5242 просмотров

Create a new resource bundle in Grails?

I'd like to create another resource bundle to organize my Grails app. Grails provides a 'messages' resource bundle and I need to create a 'myApp' resource bundle. How can I create a new resource bundle and read its properties with the 'g:message' GSP tag?

1
голосов
1ответов
5682 просмотров

Import XML into a Grails Domain Class

I am reading an XML file with a schema based on a Domain Class. Here is a simple example for illustration (my current situation concerns a lot of fields from a lot of classes) : class Player { String name Date birthDate } The XML file to read is : <players> <player name='P1' bi...

100
голосов
4ответов
79814 просмотров

What are "Groovy" and "Grails" and what kinds of applications are built using them?

Nowadays I hear a lot about "Groovy on Grails" and I want to know more about it: What is Groovy? What is Grails? What kind of applications are built using Groovy on Grails?

15
голосов
4ответов
9035 просмотров

Grails multi column indexes

Can someone explain how to define multi column indexes in Grails? The documentation is at best sparse. This for example does not seem to work at all: http://grails.org/GORM+Index+definitions I've had some luck with this, but the results seems random at best. Definitions that works in one domain...

11
голосов
2ответов
12751 просмотров

Calling a shell script from a Groovy/Grails Application

How can I call a native shell script from a Groovy / Grails Application? The shell script resides on the same machine.