JavaEE 应用程序中的 app-inf 和 web-inf 文件夹有什么区别? [英] What difference between app-inf and web-inf folders in JavaEE applications?
问题描述
您能否让我了解一下 javaEE 应用程序中 APP-INF 和 WEB-INF 文件夹之间的主要区别.
Can you give me understanding of main difference between APP-INF and WEB-INF folders in javaEE applications.
谢谢
推荐答案
APP-INF
在一个包含许多 war 和 jar(例如 WebApp1.war、WebApp2.war、EJB1.jar 和 EJB2.jar)的企业应用程序(EAR 应用程序)中,假设所有这些模块都想使用一些可用的类作为 Jar (common.jar) 的一部分.所以在这种情况下,最好将这个jar文件放在APP-INF"目录下,这就是为什么我们不需要在每个模块中放置4次相同的Jar.
In an enterprise application (EAR application) which contains many war and jars (eg.WebApp1.war, WebApp2.war, EJB1.jar and EJB2.jar.) and suppose all these Modules want to use some classes which is available as part of a Jar (common.jar). So in this case it is better to Place this jar file inside under "APP-INF" directory,that why we don't need to put the same Jar 4 times inside each and every Modules.
WEB-INF
WEB-INF 目录是 Web 应用程序的私有区域,WEB-INF 目录下的任何文件都不能通过指定 URL 直接从浏览器访问.
WEB-INF is a directory that is a private area of the web application, any files under WEB-INF directory cannot be accessed directly from browser by specifying the URL.
查看EAR应用结构;
这篇关于JavaEE 应用程序中的 app-inf 和 web-inf 文件夹有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!