users@jersey.java.net

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

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 22 Apr 2009 13:38:22 +0200

On Apr 22, 2009, at 1:30 PM, James Strachan wrote:

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


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

http://lampsvn.epfl.ch/trac/scala/ticket/1539

Any reference to WebResource causes the compiler to vomit.


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

Indeed!

I would love to demo something like this at the Jersey BOF @ JavaOne :-)

Paul.