Where to put static files such as CSS in a spring-boot project?

后端 未结 10 2008
猫巷女王i
猫巷女王i 2020-12-02 09:47

In my current spring-boot project, my views have this line:


to reference a static css

10条回答
  •  無奈伤痛
    2020-12-02 10:25

    In my case to reference files inside css and js folders like this:

    
    
    
    

    I had to place the folders in webapp folder. I have the following folder structure:

    Myapp

    -src
         -main
               -java
               -resources
                        -static
                        -templates
               -webapp
                      -resources
                      -WEB-INF
    

    I mean if i had placed the css and js folders in resources folder (under main) it would have been:

    
    
    
    

    If i place them in static folder (under resources) it doesn't work.

提交回复
热议问题