.jar文件和.war文件有什么区别? 仅仅是文件扩展名还是还有其他的东西?
当前回答
WAR代表Web应用程序存档
JAR代表Java存档
其他回答
战争:网络应用 Jar:用于桌面应用程序
OR
战争:开发浏览器 在机器上工作
.war文件是运行在应用服务器内部的Web应用程序存档文件,而.jar文件是在用户机器上运行桌面应用程序的Java应用程序存档文件。
Jar:—Jar只包含.class War: War包含html, js, CSS和.class以及JSP和servlet页面
You add web components to a J2EE application in a package called a web application archive (WAR), which is a JAR similar to the package used for Java class libraries. A WAR usually contains other resources besides web components, including: Server-side utility classes (database beans, shopping carts, and so on). Static web resources (HTML, image, and sound files, and so on) Client-side classes (applets and utility classes) A WAR has a specific hierarchical directory structure. The top-level directory of a WAR is the document root of the application. The document root is where JSP pages, client-side classes and archives, and static web resources are stored.
(源)
所以。war是一个。jar,但它包含web应用程序组件,并根据特定的结构进行布局。.war被设计为部署到web应用服务器(如Tomcat或Jetty)或Java EE服务器(如JBoss或Glassfish)。
基本上都是压缩档案。War用于具有特定目录结构的web应用程序。
推荐文章
- 在流中使用Java 8 foreach循环移动到下一项
- 访问限制:'Application'类型不是API(必需库rt.jar的限制)
- 用Java计算两个日期之间的天数
- 如何配置slf4j-simple
- 在Jar文件中运行类
- 带参数的可运行?
- 我如何得到一个字符串的前n个字符而不检查大小或出界?
- 我可以在Java中设置enum起始值吗?
- Java中的回调函数
- c#和Java中的泛型有什么不同?和模板在c++ ?
- 在Java中,流相对于循环的优势是什么?
- Jersey在未找到InjectionManagerFactory时停止工作
- 在Java流是peek真的只是调试?
- Recyclerview不调用onCreateViewHolder
- 将JSON字符串转换为HashMap