开发者

How do I convert an Elem (with lift:surround) to a LiftResponse?

I find myself needing to produce a LiftResponse, and I have an existing piece of code that produces a Elem, inside of which is

stuff

How do I tu开发者_Go百科rn this into a LiftResponse? (I'm using Lift 2.2M1.)


Via the mailing list, David Pollak suggests

val r: Req = ... 
val myResponse: Box[LiftResponse] = 
for { 
  session <- S.session 
  template = TemplateFinder.findAnyTemplate("my_templates" :: "my_template" :: Nil) 
  response <- session.processTemplate(template, r, r.path, 200) 
} yield response 

although that thread also tries to explain why what I was trying to do was a bit strange in the first place.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜