.jar文件和.war文件有什么区别? 仅仅是文件扩展名还是还有其他的东西?
当前回答
战争:网络应用 Jar:用于桌面应用程序
OR
战争:开发浏览器 在机器上工作
其他回答
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应用程序存档文件,而.jar文件是在用户机器上运行桌面应用程序的Java应用程序存档文件。
战争:网络应用 Jar:用于桌面应用程序
OR
战争:开发浏览器 在机器上工作
Jar:—Jar只包含.class War: War包含html, js, CSS和.class以及JSP和servlet页面
War和jar是Java文件的存档。战争是网络档案,他们运行在网络服务器上。Jar是Java归档文件。
推荐文章
- 如何在java中格式化持续时间?(如格式H:MM:SS)
- urlencoder .encode(字符串)已弃用,我应该使用什么代替?
- javax.transaction.Transactional vs . org.springframework.transaction.annotation.Transactional
- Java 8接口方法中不允许“同步”的原因是什么?
- 如何找到Java堆大小和内存使用(Linux)?
- 使用Enum实现单例(Java)
- RabbitMQ与通道和连接之间的关系
- buildSessionFactory()配置方法在Hibernate中已弃用?
- Spring MVC -如何获得所有的请求参数在一个地图在Spring控制器?
- 如何在Java中按两个字段排序?
- 文件之间的差异。路径中的分隔符和斜杠
- 在方法参数中使用NotNull注释
- Spring MVC中处理可选参数的@RequestParam
- Tomcat:如何查找正在运行的Tomcat版本?
- “java”、“javaw”和“javaws”之间有什么区别?