Title says it all. Sometimes we need access to the raw request/response objects
NO please don't do this !!!
It can be done today as:
S.containerRequest.map(r => (r.asInstanceOf[HTTPRequestServlet]).req)
Lift code should not hold explicit javax.servlet references outside of net.liftweb.http.provider.servlet package
mariusdanciu: is there also a way to get the HttpServletResponse?
Lift by design hides HttpServletResponse and this is a very good thing. Lift represents responses as LiftResponse which has many subclasses, XmlResponse, JsonResponse, RedirectResponse etc.
You can still have access to servlet response from LiftRules
case (liftResponse, httpResponse, _ ) => httpResponse.asInstanceOf[HTTPResponseServlet].resp
but before send is called right before sending the response to client. I'm not sure if this will be enough though.
Exposing HTTPResponse to S would open a gate for hacks, as people may use it to directly write things to outputstream ... and this will bypass Lifts processing pipeline. I think we should seriously discuss this on the public list
You can us javax.servlet.http.HttpServletResponseWrapper to pass to the facebook library. Extending HttpServletResponseWrapper you can produce a LiftResponse that Lift would understand and this should be pretty straight forward
And this should not imply Lift changes.
Closing the ticket.
See http://groups.google.com/group/liftweb/browse_frm/thread/bbc8e000b64b8f8f?hl=en# for a description of how to access the raw request.
Imported from GitHub: http://github.com/dpp/liftweb/issues/72/find
Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/72