views:

494

answers:

2

I'd like to do the following but am not sure if it can be done and if so how. Create a Grails application on my local machine and test it. Then somehow package it up along with the Jetty server, and install it on a users desktop. The installer would put an icon in the start menu that would launch the server and load the start page in either the users default browser, or a Java application that would imbed the webpage.

+2  A: 

If Jetty is not a high priority item you can try the Winstone servlet container. You can create an "executable war file" which either can be deployed on a servlet container or simply start with java -jar your.war.

Winstone integration for Grails are on radar so maybe Grails can produce "executable war" in the future.

The start menu and desktop integration can be quite easily created using an installer creation software (e.g. NSIS).

UPDATE: it seems that there is something work differently (or broken) in winstone from version 0.9.5 (it was the first version which supports Servlet 2.5/JSP 2.1). I tried some older versions and 0.8.1 seems to work fine with my test Grails application.

Csaba_H
Thanks, I'm trying this out now. I'd rather use Jetty since Winstone hasn't been updated in over a year but if this works I may just stick with it.
Jared
The app runs, but I am unable to get database controlers to work using an imbedded database, I'll have to see about using one that isn't imbedded.
Jared
Hmmm, interesting. I have just tried a simple Grails application and I got empty pages as well :( Trying to figure out what the hell is happening...
Csaba_H
A: 

I find the issue, but I don't know how to solve it. When you hit /controller/action, it issues a 302 (redirect) to request /controller/action.dispatch. For some reason this 302 is not interpreted by the "grails" dispatch servlet. If you access /controller/action.dispatch directly, it works flawlessly.

Does anyone knows how to fix this or at least debug it?

LaSombra
It seems that all requests to "grails" servlet are going to /grails returning a 404.Do not consider the above explanation.
LaSombra