Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot - Proper location for html files

I am new to Spring Boot and I am trying to add a simple html page for my project At the moment, my project's structure is the following:

enter image description here

Having read the following: https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot

http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-static-content

and other answers in StackOverflow, I'd expect to see the contents of index.html when I visit http://localhost:8080/

What could I be missing?

like image 603
mariosk89 Avatar asked Oct 30 '22 07:10

mariosk89


1 Answers

As there is no webapp in SpringBoot project , we can place the html files in either in

src/main/resources/resources/index.html
src/main/resources/static/index.html 
src/main/resources/public/index.html 

Remember the above is in highest to lowest precedence.

To check your file run the main class in eclipse and go to http://localhost:8080/index.html

like image 94
Chinmoy Avatar answered Nov 08 '22 08:11

Chinmoy