This might seem a truly bizarre request - particularly to folks who
solely use lift as their web framework; but I've been hacking up a
number of JAXRS services - I'm a big JAXRS fan (and slowly being drawn
to scala/lift).

I'd like to make Lift templates an option for any JAXRS developer
who's made a RESTful service and wants nice HTML/XML/Atom views using
Lift snippets etc. A thread recently started on the Jersey list btw...
http://n2.nabble.com/using-Lift-templates-with-Jersey-%28was-Re%3A--Jersey--custom--TemplateProcessor-not-having-its-constructor-injected-%29-td2675518.html

I've started hacking up a Jersey TemplateProcessor to wire in Lift
templates using implicit views; I can grab the template using Lift's
TemplateFinder fine - but I've just not got enough Lift implementation
knowledge yet to figure out how to render it :). I tried using
LiftServlet but thats a bit of a hack and it tends to just return the
template itself (since I'm not using Lifts mapping of URIs to requests
etc) - I kinda need to go in somewhere in between the two :)

FWIW I'm imagining two possible options

(i) folks write Java Resource Beans for JAXRS then wire Lift templates
using the @ImplictProvides mechanism to hook a resource bean to the
Lift template

(ii) folks create markup - or template instantiations within their
JAXRS beans written in Scala then there's no need for the
@ImplicitProvides hook. e.g.

@Path("/bar")
class MyResource {

  @GET
  @Produces(Array("text/html"))
  def view() = <html><body><h1>Hello World!</h1></body></html>

  ...

  @POST
  def foo(form: SomeBean) = {...}
}

In either case, I need some little hook to be able to take a
Box[NodeSeq] and pass it to Lift to render it using the standard lift
tags + snippets etc.

This could be a gentle way to get folks gradually hooked on
Scala/Lift; gradually moving from Java/JSP to Scala/Lift for
templates, then resource beans etc. (Changing web frameworks is often
a big decision to make, though switching out JSP and using Lift
templates is a kinda no brainer... :)

I wondered if any Lift ninja's could give me some hints at a clean way
to do this?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to