今天新建了个web项目,试了下buildPath来添加jar包,结果运行时提示找不到相关jar包;后来将jar包复制到WEB-INF/lib下,运行成功。然后在网上查了下,原来如此:
Build path jars are not a part of your web app.
On the other hand, the WEB-INF/lib
jars are a part of your project.
The advantage of having WEB-INF/lib
jars over build path jars is that they get bundled into your app when generating a WAR
file.
This comes in handy when you want to deploy your app on some server where you don't have access to modify the jars in the build path.