hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schwartz <MSchwa...@dtcc.com>
Subject Setting Remote User Header
Date Mon, 10 Oct 2005 21:17:31 GMT
I have an application that uses the 
javax.servlet.http.HttpServletRequest.getRemoteUser() method to pick up 
what user was previously authenticated. 
I wrote the code below, but request.getRemoteUser() in my JSP still 
returns null. Do I need to write a class that implements AuthScheme to do 
this?

                HttpClient client = new HttpClient();
                HttpMethod method = new GetMethod(url);
                method.setRequestHeader("REMOTE_USER", testUser);
                String responseBody = null;
                try{
                        client.executeMethod(method);
                        responseBody = method.getResponseBodyAsString();
                } catch (HttpException he) {
                        System.err.println(
                                "Http error connecting to '" + url + "'");
                        System.err.println(he.getMessage());
                } catch (IOException ioe) {
                        System.err.println(
                                "Unable to connect to '" + url + "'");
                }


Thanks in advance. 

Mike Schwartz
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message