Standalone Grails app

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Standalone Grails app

typoknig
This post was updated on .
I would like to use Grails to develop an application that can run locally on a user's computer.  I have been using the Standalone plugin and it does what it is supposed to do, but it is a bit slow to start up the embedded Tomcat/Jetty server, and there is fear from some within my organization about firewall restrictions our app may encounter when it is hosted from localhost.

Is there any way to run a Grails app without a server in its own browser?  Maybe using some technology like CEF kind of like node-webkit does?

I have been exploring Griffon as a desktop alternative to Grails, but it just isn't the same :(  I want to be able to write my UI in HTML, not swing.  Grails does everything I want, I just need it to act more like a desktop application in regards to how it is run.
Reply | Threaded
Open this post in threaded view
|

Re: Standalone Grails app

Jeff Scott Brown


On December 19, 2013 at 2:09:34 PM, typoknig ([hidden email]) wrote:

>  
> I would like to use Grails to develop an application that can run  
> locally on
> a user's computer. I have been using the Standalone plugin
> and it does what it  
> is supposed to
> do, but it is a bit slow to start up the embedded Tomcat/Jetty server,  
> and
> there is fear from some within my organization about firewall  
> restrictions
> our app may encounter when it is hosted from localhost.

Grails apps run in a container.  You can run an instance of Tomcat or Jetty or some other servlet container on your machine and deploy your Grails app to that container if you like.

>  
> Is there any way to run a Grails app without a server in its own browser? 

That question doesn’t really make sense.  The Grails app has to be hosted on some machine, call it a server or don’t call it a server.  Then the app can be interacted with from the same machine or from other machines, depending on your network setup.

>  
> I have been exploring Griffon as a desktop alternative to Grails,  
> but it
> just isn't the same :(

Griffon isn’t supposed to be the same.  Griffon is a framework for building fundamentally different types of apps.  



JSB
--
Jeff Scott Brown
[hidden email]

Autism Strikes 1 in 166  
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Standalone Grails app

typoknig
Jeff Scott Brown wrote
Grails apps run in a container.  You can run an instance of Tomcat or Jetty or some other servlet container on your machine and deploy your Grails app to that container if you like.
Yes, I have explored that avenue.  I wrote:

typoknig wrote
it is a bit slow to start up the embedded Tomcat/Jetty server, and there is fear from some within my organization about firewall restrictions our app may encounter when it is hosted from localhost.
An embedded server like what the Standalone plugin provides would work, but it needs:

1.) To start faster
2.) To run in an embedded browser (i.e. not a browser that is installed on the user's machine, one that is packaged with the app).

Jeff Scott Brown wrote
That question doesn’t really make sense.  The Grails app has to be hosted on some machine, call it a server or don’t call it a server.
How does that not make sense?  I'm asking if serving via Tomcat/Jetty/etc. is the only way to host or otherwise run a Grails app.  I figured the answer would be no, but I wanted to make sure there wasn't some unconventional way to do what I want.

Jeff Scott Brown wrote
Griffon isn’t supposed to be the same.  Griffon is a framework for building fundamentally different types of apps.
Yes I realize that, but since Griffon is the closest thing I know of to Grails for a desktop app that is what I was exploring.  Grails and Griffon are very similar in some respects, but not others, hence my comment.

Reply | Threaded
Open this post in threaded view
|

Re: Standalone Grails app

Owen Rubel
I understand where you are coming from and where you are going with this but Grails isn't PHP and it requires a VM to compile and run the bytecode. No one embeds a VM in a browser and even if they did, combining a client and server IS silly as they are two separate apps and are meant to be separated. Why would anyone embed Apache in Firefox? Hence no one would embed Tomcat in a browser either.
Reply | Threaded
Open this post in threaded view
|

Re: Standalone Grails app

typoknig
The reason I need this functionality is this:

A web app will meet the requirements of 95% of our users, but the other 5% need an offline solution.  If I cannot find a way to meet the offline requirement we will have to make a full blown desktop application.  We don't have the resources to do an online app and an desktop app so we would have to make only the desktop app.  The Standalone plugin got me close to having both an online and desktop app in one, but not close enough for the decision makers.
Reply | Threaded
Open this post in threaded view
|

Re: Standalone Grails app

alxndrsn
On 20 December 2013 01:25, typoknig <[hidden email]> wrote:
> The reason I need this functionality is this:
>
> A web app will meet the requirements of 95% of our users, but the other 5%
> need an offline solution.  If I cannot find a way to meet the offline
> requirement we will have to make a full blown desktop application.  We don't
> have the resources to do an online app and an desktop app so we would have
> to make only the desktop app.  The Standalone plugin got me close to having
> both an online and desktop app in one, but not close enough for the decision
> makers.

You might find what we've done with FrontlineSMS interesting - as a
Grails app it obviously runs inside a Java Servlet container, but we
use Install4j to package the app into a desktop installer, and include
a systray icon for launching the localhost URL within the user's
standard web browser.  Have a look at
https://github.com/frontlinesms/frontlinesms2/tree/master/plugins/frontlinesms-core/install
for more.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Standalone Grails app

Martin Minka
My application is running as hosted solution, so user needs only browser to use it. That is typical usage.
There is option to download installation package for local usage on desktop. User does installation (windows or linux) and he gets shortcut to launch application.
After launching the application, system tray icon is created with 2 menu options: quit application and to launch default browser (on http://localhost:<port selected on installation time>).

Basicaly I am doing the same as Alex in frontlinesms. My recipe is:

  • build standalone jar with jetty support
  • extract the JAR - it sepeeds up application launching a lot becasue otherwise the WAR is always unpacked on start
  • use http://izpack.org/ to build native Java installation package
  • use launch4j to produce EXE installation package to make Windows users happy
  • write small system tray icon application as Alex did in frontlinesms to allow user to control application
  • or use http://yajsw.sourceforge.net/ to add tryicon and daemon support
    • in config use: wrapper.java.app.mainclass=grails.plugin.standalone.JettyLauncher

You will not get around to start Jetty on desktop. It should be possible to distribute portable Firefox or http://crportable.sourceforge.net/ with you application to be sure that your application will work.

Hope it helps you little bit.



2013/12/20 Alex Anderson <[hidden email]>
On 20 December 2013 01:25, typoknig <[hidden email]> wrote:
> The reason I need this functionality is this:
>
> A web app will meet the requirements of 95% of our users, but the other 5%
> need an offline solution.  If I cannot find a way to meet the offline
> requirement we will have to make a full blown desktop application.  We don't
> have the resources to do an online app and an desktop app so we would have
> to make only the desktop app.  The Standalone plugin got me close to having
> both an online and desktop app in one, but not close enough for the decision
> makers.

You might find what we've done with FrontlineSMS interesting - as a
Grails app it obviously runs inside a Java Servlet container, but we
use Install4j to package the app into a desktop installer, and include
a systray icon for launching the localhost URL within the user's
standard web browser.  Have a look at
https://github.com/frontlinesms/frontlinesms2/tree/master/plugins/frontlinesms-core/install
for more.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Standalone Grails app

graham
I'm in agreement with Alexander and Martin - my company's old package is purely a desktop app (client-server over a LAN etc.) but when we moved to redevelop it a web-based approach seemed best: our users will get a better UI (*) and more flexibility (single PC, LAN, cloud, web) and so do we (we could package it a web service) all with essentially the same software.
I'm sure that initially all of our users will be running the system on a LAN and a small number of our users  will probably have everything running on one PC - I must admit that we haven't got as far as the others so I was interested to see exactly what they have been doing - but I don't envisage that as a problem. Provided that the installation is sound and the third party software is reliable (and/or has sensible errors and logs when necessary) it should simply run quite happily in the background leaving your own software doing the appropriate tasks via, more or less, any old browser and it is straightforward to install the appropriate shortcut etc. to launch the specific browser + url.
* Perhaps not everyone does like HTML/Javascript but it is, dare I say it, what people have gotten used to, so there shouldn't be too much problem with acceptance unless the UI has some uncommon features.
I should also add that we do have a few Griffon applications: they were developed for tactical reasons but I have wondered about doing the whole application in Griffon perhaps with REST/Grails backend, but we're probably too far done the Grails route now.

graham