--- John Baker <[EMAIL PROTECTED]> wrote: > Hello. > > I'm am trying to write a Valve, very much like > SingleSignOn but for our > authetnication system that uses more than just a > username and password. I > want my Valve to pass login information from one > Session to another when a > user uses different webapps (Contexts). > > I am nearly there codewise, but have a small > problem. I do not seem to be able > to get the session from the request! I've tried > calling request.getSession() > and request.getSession(true) yet both return null. > It's hardly worth pasting, > but: > > public void invoke(Request request, Response > response, ValveContext context) > throws IOException, ServletException > { > System.out.println( > ((HttpRequest)request).getSession(true) ); > > Will always print null.
Shouldn't you be using this instead? (HttpServletRequest request, HttpServletResponse response, ValveContext context) Also, why are you casting HttpSession to HttpRequest? That should cause an exception since HttpServletRequest extends ServletRequest and HttpSession doesn't extend either interface. peter lin __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>