Best location to put your CSS and JS files in a Mavenized Java Web app?

前端 未结 4 2173
情话喂你
情话喂你 2021-02-08 03:05

I have a Web application in maven that follows this structure:

src
`-- main
    |-- java
    |-- resources
    `-- webapp

Is is better to put i

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-08 03:51

    If you don't need to filter CSS and JS files, I would simply put them in src/main/webapp (if you put them in src/main/resources, they will end up in target/classes and in WEB-INF/classes in the WAR which is very unlikely what you want). If you need to filter them, additional resources can be included in the WAR using the webResources parameter. Have a look at Adding and Filtering External Web Resources for more details.

提交回复
热议问题