Saturday, March 21, 2020

Sample Spring Project - How to add CSS and Image in Eclipse and Apache tomcat

We have found it very difficult to add an image or a css file for our sample Spring project. Below steps will give you how to achieve that.

1. Create a WebContent folder into your Eclipse project.
2. Under the WebContent folder, create Css folder and add your css file here
3. Under the WebContent folder,  create img folder and add your image.

The directory structure would look like below:

4. Change Deployment Assembly of the project to include WebContet folder as "/". You can go to this by "your-project"->Right click and go to Properties->Deployment Assembly


No comments:

Post a Comment