In 1.1-SNAPSHOT you don't have access to servletRequest. you have

val r: HTTPRequest = S.containerRequest

But currently HTTPRequest does not provide a way of getting the
net.liftweb.http.provider.HTTPContext.


I will add this support pretty soon. You can still do that by:

import net.liftweb.http.provider.servlet._

S.containerRequest match {
        case Full(r: HTTPRequestServlet) =>
r.req.getSession.getServletContext.getInitParameter
("foo")
        case _ => ""
      }
    )

But this is not elegant. I'll add this week (hopefully tomorrow) to
HTTPContext trait the support for getting the init params.

Br's,
Marius

On Aug 19, 9:45 pm, inca <[email protected]> wrote:
> I've got the quick-and-dirty: access HttpServletRequest and via the
> HttpSession to the ServletContext object.
> E.g.,
>
>   def fooParam = Text(
>       S.servletRequest match {
>         case Full(r) => r.getSession.getServletContext.getInitParameter
> ("foo")
>         case _ => ""
>       }
>     )
>
> Best regards,
> inca
>
> On 19 авг, 22:29, Naftoli Gugenheim <[email protected]> wrote:
>
> > How can I read a context param (e.g. H2 sets "connection" param)?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to