Eclipse:包含带有war文件项目的库 [英] Eclipse: including libraries with war file project

查看:71
本文介绍了Eclipse:包含带有war文件项目的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用jstl库,但将其用作外部jar.将项目导出到.war文件后,这些库未包含在内,并且出现错误.我如何确定该库包含在我的战争文件中?

I use the jstl library in my project, but as an external jar. After exporting my project to a .war file, these libraries are not included and I'm getting errors. How do I make sure the library is included in my war file?

还有一个不相关的问题,如果一个ear文件只有一个war模块,是否有必要将其设置为.ear而不是.war

Also, an unrelated question, if an ear file would have only one war module, is there a point to making it an .ear instead of .war

推荐答案

如果将jstl jar放在WebContent目录中,它们将打包在WAR文件中.但是,如果要从其他地方加载它们,请确保将它们包含在导出列表中(项目属性-> Java构建路径->订单和导出).

If you have put the jstl jars inside WebContent directory they will be packed in your WAR file. But if you are loading them from somewhere else make sure that you have them in your export list (Project Properties -> Java Build Path -> Order and Export).

如果您有EAR文件,则可以在application.xml文件中进行一些额外的设置,甚至可以进行一些容器特定的设置.

If you have an EAR file you can make some extra settings in your application.xml file, or even some container specific ones.

这篇关于Eclipse:包含带有war文件项目的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆