maven webapp to place jsps in /WEB-INF/jsp

前端 未结 2 1595
梦如初夏
梦如初夏 2021-02-06 09:28

I have inherited a webapp built using NetBean\'s internal ant.

All jsps reside in:

WEB-INF/jsp

And the web.xml has hardcoded links to /

2条回答
  •  花落未央
    2021-02-06 09:51

    Also note that everything in src/main/resources will be "on the classpath", i.e., it all is copied to my-webapp/WEB-INF/classes when the war is built. So that's a good place to put your configuration files, for example, log4j.xml / logback.xml, or Spring's applicationContext.xml and Spring's other config files, which you can then easily reference with classpath:somefile.xml.

    What also makes this very nice is you can set up filters in maven so that it transforms the files from src/resources before it puts them in the war file.

    So if you have any config files, other than web.xml, in src/main/webapp/WEB-INF, think about moving them to the src/main/resources directory.

提交回复
热议问题