The login servlet is registered with a security group in the system, and
properly
prompts the user, at which point he logs in and request.getRemoteUser
returns
his username.
Unfortunately, after he is redirected to a JSP page request.getRemoteUser
returns
null, even though the user is still authenticated (if I go back to the login
servlet
I am not re-prompted for a username/password).
Does anyone have insight into why this is not working?
Thanks,
-David
Here are the relevant sections of both the servlet and a JSP page using it
=============================
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
String UserId=new String();
try{
HttpSession session = request.getSession(true);
System.out.println(request.getRemoteUser());
String userId=new String(request.getRemoteUser()); <-returns correct
name
session.putValue("userId", userId);
response.sendRedirect("http://localhost:7001/jsp/foo.jsp");
}catch(Exception e){};
}
(prints out username to the console, forwards the user to the jsp page)
--relevant jsp code-
<%@ page session="true" %>
<% System.out.println("req.getRemoteUser="+request.getRemoteUser()); %>
(prints out null to the console)
.paul
-David
"paul a. bauerschmidt" <paul.bau...@bea.com> wrote in message
news:395A7BA7...@bea.com...
Use request.getPrincipal().getName().
Cameron Purdy, LiveWater
"David Regan" <dre...@callidussoftware.com> wrote in message
news:395a...@newsgroups.bea.com...