users@jersey.java.net

using Lift templates with Jersey (was Re: [Jersey] custom TemplateProcessor not having its constructor injected?)

From: James Strachan <james.strachan_at_gmail.com>
Date: Wed, 22 Apr 2009 12:30:33 +0100

Figured changing the subject might be an idea... :)

2009/4/22 Paul Sandoz <Paul.Sandoz_at_sun.com>:
> On Apr 22, 2009, at 1:11 PM, James Strachan wrote:
>
>> I tried creating a custom TemplateProcessor instance like the
>> JSPTemplateProcessor using a similar constructor... (I'm experimenting
>> using LiftWeb.net's templates with Jersey 1.0.3 - I'm slowly being
>> drawn to scala...)
>>
>
> I have been drawn to Scala too and wondered if the lift type
> templates/snippets could be integrated.

Yeah; the lift templates could be an awesome alternative to JSP + JSTL
+ EL + custom tags + JSP fragments + SiteMesh/Tiles...


> I think there is some potential to provide some nice Scala wrappers on some
> stuff, and use of partial functions for resource methods.

Agreed! My thinking too...

> The only current
> down side is a compiler bug that stops the client side being used :-(

Really? I've not hit that one - what is it?

I've managed to get a TemplateProcessor find the Lift template using
implicit views (so your resources can be Java and it can find a
related lift template); I've just not grokked the internals of Lift
enough yet to figure out how to actually render it yet :)

Though a simpler model would be just to use scala for the resource and
return a template instantiation for HTML/XML views - but having both
options would rock.

-- 
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/