JAR vs WAR file specification

前端 未结 4 1487
我寻月下人不归
我寻月下人不归 2020-12-21 08:57

I noticed that WAR files are supposed to have classes/ and lib/ directories for containing their classfile root and dependencies, respectively.

4条回答
  •  不思量自难忘°
    2020-12-21 09:50

    Because unless you use a custom classloader that can load classes from nested jars (like JarClassLoader), you can't load classes from nested jars. Servlet and app containers will add jars contained inside war/ear files to their application's classpath.

提交回复
热议问题