}
// Send to stashed request
else {
// Iterate back as far as we can
ServletRequest wrapperCheck = request;
while (wrapperCheck instanceof HttpServletRequestWrapper) {
wrapperCheck = ((HttpServletRequestWrapper) wrapperCheck).getRequest();
}
// Get the stashed request
WinstoneRequest actualRequest = null;
if (wrapperCheck instanceof WinstoneRequest) {
actualRequest = (WinstoneRequest) wrapperCheck;
actualRequest.setRemoteUser(principal);
} else {
Logger.log(Logger.WARNING, AUTH_RESOURCES,
"FormAuthenticationHandler.CantSetUser",
wrapperCheck.getClass().getName());
}
HttpSession session = request.getSession(true);
String previousLocation = this.loginPage;
RetryRequestParams cachedRequest = (RetryRequestParams)
session.getAttribute(CACHED_REQUEST);