今天新建了个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.
本文探讨了在Java Web项目中使用WEB-INF/lib文件夹与通过Eclipse的BuildPath添加JAR包的区别。指出WEB-INF/lib中的JAR包会打包进WAR文件,便于部署在无法修改BuildPath的服务器上。

8478

被折叠的 条评论
为什么被折叠?



