users@jersey.java.net

Re: [Jersey] LiftTemplateProcessor.scala <was> Re: svn commit: r2657 - trunk/jersey/contribs/scala: . jersey-lift/src/main/scala/com/sun/jersey/lift

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 17 Aug 2009 13:07:12 +0200

On Aug 17, 2009, at 10:22 AM, James Strachan wrote:

> 2009/8/17 Paul Sandoz <Paul.Sandoz_at_sun.com>:
>>
>> On Aug 13, 2009, at 12:04 PM, jstrachan_at_dev.java.net wrote:
>>
>> + // TODO this code actually results in looking up the
>> resource twice
>> + // once here first then again Lift land
>> + // I wonder if there's a better way to do this just once?
>> + if (servletContext.getResource(path) == null) {
>> + if (servletContext.getResource(path + ".html") == null &&
>> + servletContext.getResource(path + ".xhtml") == null) {
>> + return null
>> }
>> }
>>
>> James, if TemplateProcessor was the following:
>> public interface TemplateProcessor<T> {
>>
>> T resolve(String name);
>> void writeTo(T resolvedObject, Object model, OutputStream
>> out) throws
>> IOException;
>> }
>> would that help?
>
> Yes, that would be awesome! Am sure its the same for other template
> engines; you tend to resolve the name to something (a URL, stream, JSP
> page, template object or whatnot). In Lift's case that would be the
> actual template which we can then render in the writeTo method.

OK, i will work on that.

Paul.