Java Servlet Filter redirect problem -
I am having trouble with my certification filter when the login login page redirects, if any image is displayed in JSP login Does not happen. However, if I go to the login page manually on the login page, images are displayed.
I do not understand why this is happening! I appreciate any help: -)
AuthFilter:
if (authorized == tap & amp; path.indexOf ("AUTH") = = -1 & amp; Index IndexOf ("Login") == -1) {httpResponse.sendRedirect ("Login"); Return; } And {chain.doFilter (request, response); } Login servlet: // Just using a servicelet, I want to send more data to JSP Dispatcher.dispatch ("View / Login.jsp ", request, feedback);
login.jsp:
& lt; Img src = "picture / logo.png" />
jsp is otherwise "normal", all the required HTML tags are present. The "Images" folder is in the project's default "Web" folder, with all other jsp and javascripts.
Thanks in advance for any help.
This is due to relative path
- Your
log in
is in the context of the - Your images may be
/ views / images /
- As you move forward, The browser only knows the requested URL.
So when you move forward, the images are requested on Two options: Update: Make sure images are not affected by filter Two options: / images> (because
/ views / images /
request.getRequestURI ()
Comments
Post a Comment