English 中文(简体)
为什么META-INF被称为META-INF?
原标题:Why is META-INF called META-INF?

我试图解释web应用程序的基本原理。我在META-INF和WEB-INF上遇到了这个问题。这些目录是如何获得这些名称的?

最佳回答

Jar文件实际上是包含额外信息和可能更好的索引的ZIP文件。将额外信息打包到ZIP文件中时,将其放置在不太可能与普通ZIP文件内容冲突的位置变得很重要。

选择META-INF作为可以存储JAR文件信息的目录,是试图将目录用作ZIP文件中的名称空间。基本上,如果它存储在META-INF中,它就是元数据信息,或者(在元数据的可能含义中挑选),“自我信息”或“抽象信息”。

这允许在不破坏ZIP文件封装的情况下,在ZIP文件本身中存储会影响ZIP文件处理的信息。这是关键,因为它避免了创建一种新的、可移植的压缩格式并将其推广到Java代码打包的目的。随着人们习惯了META-INF的实用程序,ZIP文件中为特定的打包格式创建了新的“名称空间”,例如“WEB-INF”。

ZIP文件格式的第一个“扩展名”是添加清单(manifest.MF)和可选的索引列表(以加快项目提取)。现在,这样的文件(由于具有已知的扩展名空间)已经能够以许多其他方式进行扩展,比如最近添加了用于服务注册的子目录“services”。

当您考虑ZIP文件包含文件和目录时,只有将目录用作名称空间才有意义。

问题回答

Meta

Web

我想“Inf”是“信息”的缩写

如果我没记错的话,meta-inf就是元信息。这可能是完全错误的。如果这是正确的,你可能会猜测web inf是用于web信息的:-P





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签