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