1 /*
2  * @(#) $Id: DisplayUserInfo.java,v 1.2 2003/07/08 08:13:52 pankaj Exp $
3  *
4  * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net). 
5  * All rights reserved.
6  *
7  * The license governing the use of this file can be found in the 
8  * root directory of the containing software.
9  */
10
11import org.apache.axis.MessageContext;
12import org.apache.axis.transport.http.HTTPConstants;
13
14import javax.servlet.http.HttpServletRequest;
15
16public class DisplayUserInfo {
17    public static void display() {
18        MessageContext context = MessageContext.getCurrentContext();
19        HttpServletRequest req = (HttpServletRequest) context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
20        System.out.println("remote user = " + req.getRemoteUser());
21        System.out.println("remote principal = " + req.getUserPrincipal());
22    }
23}
24