I have been struggling with this issue all day and have searched numerous sources for answers.
The login.css file can be found at:
WebContent/resources/css/login.css
The image file is located here:
WebContent/resources/img/pencil.jpg
Despite my attempts to set the background image of the body using this CSS:
body{
background-image:url("../img/pencil.jpg") center center no-repeat;
}
This method does not seem to work! I even tried another approach: inserting an image directly into my JSP page without utilizing CSS. The JSP file is located at:
WebContent/WEB-INF/views/login.jpg
And the image is stored at:
WebContent/resources/img/calendar.png
The code in the JSP is as follows:
<img src="../../resources/img/calendar.png"/>
However, both methods failed to display the image! Everything else seems to be functioning correctly, except for the images. I cannot figure out why.
Below is the console output:
[27 17:48:25,515 DEBUG] [http-nio-8080-exec-2] servlet.DispatcherServlet - DispatcherServlet with name 'todo' processing GET request for [/ToDoList/login]
[27 17:48:26,232 DEBUG] [http-nio-8080-exec-3] servlet.DispatcherServlet - DispatcherServlet with name 'todo' processing GET request for [/ToDoList/resources/css/login.css]
[27 17:48:26,232 DEBUG] [http-nio-8080-exec-4] servlet.DispatcherServlet - DispatcherServlet with name 'todo' processing GET request for [/ToDoList/resources/js/login.js]
[27 17:48:26,232 DEBUG] [http-nio-8080-exec-5] servlet.DispatcherServlet - DispatcherServlet with name 'todo' processing GET request for [/ToDoList/resources/library/jquery-3.0.0.min.js]
...
(Additional console output)
...
[27 17:48:26,270 DEBUG] [http-nio-8080-exec-5] servlet.DispatcherServlet - Successfully completed request
[27 17:48:26,274 DEBUG] [http-nio-8080-exec-3] servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'todo': assuming HandlerAdapter completed request handling
[27 17:48:26,274 DEBUG] [http-nio-8080-exec-3] servlet.DispatcherServlet - Successfully completed request