web项目buildPath与lib的区别

今天新建了个web项目,试了下buildPath来添加jar包,结果运行时提示找不到相关jar包;后来将jar包复制到WEB-INF/lib下,运行成功。而后在网上查了下,原来如此:web

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.app

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.ui