Freemarker In A Grails App

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Freemarker In A Grails App

Jeff Brown-18
If you have interest in using Freemarker in a Grails app, please speak
up and summarize how you would like to use it and why Freemarker is
the right option for you.

Thanks for your input.



Jeff

--
Jeff Brown
SpringSource
http://www.springsource.com/

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: Freemarker In A Grails App

Bob Florian
Jeff Brown-18 wrote
If you have interest in using Freemarker in a Grails app, please speak
up and summarize how you would like to use it and why Freemarker is
the right option for you.
We are developing an application that includes an ability for users to personalize web pages and our primary interest in FreeMarker is to be the engine for that personalization.  We can't just use GSPs in this case because we need to limit what users can put into the pages and the capability of GSPs to execute arbitrary Groovy code is a non-starter.  We're using FreeMarker within our Grails app in this limited way but not as a general view layer technology.  

Our organization has a good bit of prior experience with FreeMarker and we thought about using it as an alternative to GSPs for our entire application, but we decided not to go that route because we're new to Grails and didn't want to start blazing new trails with the framework before we completely understood where the standard ones would take us.  However, if FreeMarker had been available as a view layer alternative within Grails itself or in a robust plug-in we might have made a different decision.  

Our experience so far has shown is that, while FreeMarker and GSPs are both fine view layer technologies with much to recommend each of them, FreeMarker has a performance edge, especially for pages with a lot of dynamic elements.  We built a simple test case with both GSP and FreeMarker that walks through the Grails project structure using File.listFiles() and renders the result as an HTML page with nested lists.  With a directory tree of about 4500 files, the FreeMarker version renders the page in an average time of 0.272 sec. while the GSP version takes an average of 1.080 sec.  Granted, a page with almost 5000 list nodes is pretty unusual and this test was run locally on the server.  For a typical page accessed via the internet the performance difference will probably be less. And one simple benchmark doesn't necessarily reflect how various real-world applications will perform. But an almost 4 fold reduction in page rendering time is substantial.  


Reply | Threaded
Open this post in threaded view
|

Re: Freemarker In A Grails App

mpermar
We are already using Freemarker for serveral tasks within our Grails application.

Our application it mixes grails plus many services written in pure java. Those java services needed some templating engine so freemarker was great. We didn't try to use .gsp from our Java services neither I know if that is possible. We went for the straightforward and proven solution, Freemarker+Spring.

Martin

On Thu, May 7, 2009 at 9:37 PM, Bob Florian <[hidden email]> wrote:


Jeff Brown-18 wrote:
>
> If you have interest in using Freemarker in a Grails app, please speak
> up and summarize how you would like to use it and why Freemarker is
> the right option for you.
>

We are developing an application that includes an ability for users to
personalize web pages and our primary interest in FreeMarker is to be the
engine for that personalization.  We can't just use GSPs in this case
because we need to limit what users can put into the pages and the
capability of GSPs to execute arbitrary Groovy code is a non-starter.  We're
using FreeMarker within our Grails app in this limited way but not as a
general view layer technology.

Our organization has a good bit of prior experience with FreeMarker and we
thought about using it as an alternative to GSPs for our entire application,
but we decided not to go that route because we're new to Grails and didn't
want to start blazing new trails with the framework before we completely
understood where the standard ones would take us.  However, if FreeMarker
had been available as a view layer alternative within Grails itself or in a
robust plug-in we might have made a different decision.

Our experience so far has shown is that, while FreeMarker and GSPs are both
fine view layer technologies with much to recommend each of them, FreeMarker
has a performance edge, especially for pages with a lot of dynamic elements.
We built a simple test case with both GSP and FreeMarker that walks through
the Grails project structure using File.listFiles() and renders the result
as an HTML page with nested lists.  With a directory tree of about 4500
files, the FreeMarker version renders the page in an average time of 0.272
sec. while the GSP version takes an average of 1.080 sec.  Granted, a page
with almost 5000 list nodes is pretty unusual and this test was run locally
on the server.  For a typical page accessed via the internet the performance
difference will probably be less. And one simple benchmark doesn't
necessarily reflect how various real-world applications will perform. But an
almost 4 fold reduction in page rendering time is substantial.



--
View this message in context: http://www.nabble.com/Freemarker-In-A-Grails-App-tp23429868p23434711.html
Sent from the grails - user mailing list archive at Nabble.com.


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

   http://xircles.codehaus.org/manage_email





--
Martín Pérez

Founder,
http://www.jobsket.com

Reply | Threaded
Open this post in threaded view
|

Re: Freemarker In A Grails App

Stand Trooper
Dunno if it's too late or not...but we use freemarker extensively on the Java side and with the transition to Grails it'd be nice to be able to port the existing freemarker code

timo

On Sat, May 9, 2009 at 4:24 AM, Martin Perez <[hidden email]> wrote:
We are already using Freemarker for serveral tasks within our Grails application.

Our application it mixes grails plus many services written in pure java. Those java services needed some templating engine so freemarker was great. We didn't try to use .gsp from our Java services neither I know if that is possible. We went for the straightforward and proven solution, Freemarker+Spring.

Martin


On Thu, May 7, 2009 at 9:37 PM, Bob Florian <[hidden email]> wrote:


Jeff Brown-18 wrote:
>
> If you have interest in using Freemarker in a Grails app, please speak
> up and summarize how you would like to use it and why Freemarker is
> the right option for you.
>

We are developing an application that includes an ability for users to
personalize web pages and our primary interest in FreeMarker is to be the
engine for that personalization.  We can't just use GSPs in this case
because we need to limit what users can put into the pages and the
capability of GSPs to execute arbitrary Groovy code is a non-starter.  We're
using FreeMarker within our Grails app in this limited way but not as a
general view layer technology.

Our organization has a good bit of prior experience with FreeMarker and we
thought about using it as an alternative to GSPs for our entire application,
but we decided not to go that route because we're new to Grails and didn't
want to start blazing new trails with the framework before we completely
understood where the standard ones would take us.  However, if FreeMarker
had been available as a view layer alternative within Grails itself or in a
robust plug-in we might have made a different decision.

Our experience so far has shown is that, while FreeMarker and GSPs are both
fine view layer technologies with much to recommend each of them, FreeMarker
has a performance edge, especially for pages with a lot of dynamic elements.
We built a simple test case with both GSP and FreeMarker that walks through
the Grails project structure using File.listFiles() and renders the result
as an HTML page with nested lists.  With a directory tree of about 4500
files, the FreeMarker version renders the page in an average time of 0.272
sec. while the GSP version takes an average of 1.080 sec.  Granted, a page
with almost 5000 list nodes is pretty unusual and this test was run locally
on the server.  For a typical page accessed via the internet the performance
difference will probably be less. And one simple benchmark doesn't
necessarily reflect how various real-world applications will perform. But an
almost 4 fold reduction in page rendering time is substantial.



--
View this message in context: http://www.nabble.com/Freemarker-In-A-Grails-App-tp23429868p23434711.html
Sent from the grails - user mailing list archive at Nabble.com.


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

   http://xircles.codehaus.org/manage_email





--
Martín Pérez

Founder,
http://www.jobsket.com


Reply | Threaded
Open this post in threaded view
|

Re: Freemarker In A Grails App

Jeff Scott Brown
On Wed, May 13, 2009 at 3:23 PM, Stand Trooper <[hidden email]> wrote:
> Dunno if it's too late or not...but we use freemarker extensively on the
> Java side and with the transition to Grails it'd be nice to be able to port
> the existing freemarker code
>
> timo
>

Standby.  Coming soon to a plugin repo near you.  :)



jb
--
Jeff Brown
SpringSource
http://www.springsource.com/

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: Freemarker In A Grails App

Daniel Guryca
Hey ,,, it would be great ... I'll be waiting for it too.

Cheers
Daniel

On Wed, May 13, 2009 at 10:06 PM, Jeff Brown <[hidden email]> wrote:
On Wed, May 13, 2009 at 3:23 PM, Stand Trooper <[hidden email]> wrote:
> Dunno if it's too late or not...but we use freemarker extensively on the
> Java side and with the transition to Grails it'd be nice to be able to port
> the existing freemarker code
>
> timo
>

Standby.  Coming soon to a plugin repo near you.  :)



jb
--
Jeff Brown
SpringSource
http://www.springsource.com/

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