/WEB-INF/classes vs /WEB-INF/lib

后端 未结 3 860
既然无缘
既然无缘 2021-01-01 15:20

I\'d like to package my Java EE6 web classes (beans, filters, servlets) into jar and place it into /WEB-INF/lib/ directory along with other utility

3条回答
  •  梦毁少年i
    2021-01-01 15:41

    In Tomcat Servlet container's definition: WEB-INF\classes is searched before WEB-INF\lib. You can choose to delegate your classloading to your custom classloader - even then the order above is maintained.

    If you choose to go with a different provider e.g. JBOss, Glassfish, Jetty it might have a different order, but I am not sure about those.

提交回复
热议问题