Removed unnecessary casts.

This commit is contained in:
Luke Taylor 2010-06-08 22:56:59 +01:00
parent 8bddc8f820
commit 76ebb759f3
1 changed files with 5 additions and 8 deletions

View File

@ -109,9 +109,6 @@ public class LoginUrlAuthenticationEntryPoint implements AuthenticationEntryPoin
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException)
throws IOException, ServletException { throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String redirectUrl = null; String redirectUrl = null;
if (useForward) { if (useForward) {
@ -119,17 +116,17 @@ public class LoginUrlAuthenticationEntryPoint implements AuthenticationEntryPoin
if (forceHttps && "http".equals(request.getScheme())) { if (forceHttps && "http".equals(request.getScheme())) {
// First redirect the current request to HTTPS. // First redirect the current request to HTTPS.
// When that request is received, the forward to the login page will be used. // When that request is received, the forward to the login page will be used.
redirectUrl = buildHttpsRedirectUrlForRequest(httpRequest); redirectUrl = buildHttpsRedirectUrlForRequest(request);
} }
if (redirectUrl == null) { if (redirectUrl == null) {
String loginForm = determineUrlToUseForThisRequest(httpRequest, httpResponse, authException); String loginForm = determineUrlToUseForThisRequest(request, response, authException);
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("Server side forward to: " + loginForm); logger.debug("Server side forward to: " + loginForm);
} }
RequestDispatcher dispatcher = httpRequest.getRequestDispatcher(loginForm); RequestDispatcher dispatcher = request.getRequestDispatcher(loginForm);
dispatcher.forward(request, response); dispatcher.forward(request, response);
@ -138,11 +135,11 @@ public class LoginUrlAuthenticationEntryPoint implements AuthenticationEntryPoin
} else { } else {
// redirect to login page. Use https if forceHttps true // redirect to login page. Use https if forceHttps true
redirectUrl = buildRedirectUrlToLoginPage(httpRequest, httpResponse, authException); redirectUrl = buildRedirectUrlToLoginPage(request, response, authException);
} }
redirectStrategy.sendRedirect(httpRequest, httpResponse, redirectUrl); redirectStrategy.sendRedirect(request, response, redirectUrl);
} }
protected String buildRedirectUrlToLoginPage(HttpServletRequest request, HttpServletResponse response, protected String buildRedirectUrlToLoginPage(HttpServletRequest request, HttpServletResponse response,