I have a problem with an authentication filter. When a filter redirects to the login page, images are not displayed in the login JSP. However, if I go to the login page manually after logging in, images will be displayed.
I do not understand why this is happening! I appreciate any help. :-)
AuthFilter:
if (authorized == null && path.indexOf("Auth") == -1 && path.indexOf("Login") == -1 ) {
httpResponse.sendRedirect("Login");
return;
} else {
chain.doFilter(request, response);
}
Input Servlet:
Dispatcher.dispatch("views/login.jsp", request, response);
login.jsp:
<img src="images/logo.png" />
jsp is otherwise "normal", all necessary HTML tags are present. The "images" folder is located in the default "web" folder of the project, along with all other jsp and javascripts.
Thanks in advance for any help. :)
- Stian
source
share