简体   繁体   English

Eclipse:包含带有war文件项目的库

[英]Eclipse: including libraries with war file project

I use the jstl library in my project, but as an external jar. 我在项目中使用jstl库,但将其用作外部jar。 After exporting my project to a .war file, these libraries are not included and I'm getting errors. 将项目导出到.war文件后,这些库未包含在内,并且出现错误。 How do I make sure the library is included in my war file? 我如何确保该库包含在我的战争文件中?

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 另外,一个无关的问题,如果一个ear文件只有一个war模块,是否有必要将其设置为.ear而不是.war。

If you have put the jstl jars inside WebContent directory they will be packed in your WAR file. 如果将jstl jars放在WebContent目录中,它们将打包在WAR文件中。 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). 但是,如果要从其他地方加载它们,请确保将它们包含在导出列表中(项目属性-> Java构建路径->订单和导出)。

If you have an EAR file you can make some extra settings in your application.xml file, or even some container specific ones. 如果您有EAR文件,则可以在application.xml文件中进行一些附加设置,甚至可以进行一些容器特定的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM