Where to place images/CSS in spring-mvc app?

后端 未结 7 1307
情话喂你
情话喂你 2020-12-05 08:14

I used Netbeans to create a Spring MVC 3.0 app. I have a simple controller and JSP view. The JSP view appears correctly except for an image that doesn\'t render. My direc

7条回答
  •  没有蜡笔的小新
    2020-12-05 08:57

    A bit old, but let me add my bit here. It is generally preferred to hide the .css/ .js files from direct public access by placing them into the main/java/webapp folder instead of the WEB-INF.

    The reasons are explained very well in the posts below:

    • What is WEB-INF used for in a Java web application?
    • How to access css/js files in jsps, all of them are placed in WEB-INF?? (spring forum)

提交回复
热议问题