javaee-api 和 javaee-web-api 有什么区别? [英] What is the difference between javaee-api and javaee-web-api?

查看:114
本文介绍了javaee-api 和 javaee-web-api 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到根据 Java servlet 规范等进行编译需要这些依赖项,但我不清楚它们之间的区别,以及何时应该使用一个而不是另一个.

I realise these dependencies are required for compiling against Java servlet specification, and so on, but I'm not clear on the differences between them, and when I should use one as opposed to the other.

它们之间有什么区别?一个是另一个的超集吗?

What is the difference between them? Is one a superset of the other?

<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>

dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-web-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>

推荐答案

javaee-web-api 应该支持 Java EE Web 配置文件.

在 Java EE 6 中引入的 Web Profile 从根本上简化了平台,并为轻量级、敏捷、引人注目的应用服务器创造了新的曙光,并专注于 Web 应用程序开发.

Introduced in Java EE 6, the Web Profile radically streamlines the platform and enables the creation of a new dawn of lightweight, agile, compelling application servers with a laser focus on web application development.

但是,如果您比较两个不同的 jar 文件,它们之间几乎没有什么不同.我在 7-zip 中打开它们,这两个屏幕截图显示了唯一的 (AFAIK) 差异,即 javaee-web-api 中不支持 JMSxml 库在 javaee-api 中似乎更大.

However if you compare the two different jar files there is little that differs between them. I opened them up in 7-zip and these two screenshots shows the only (AFAIK) differences, namely that there is no support for JMS in the javaee-web-api and that the xml library seems to be larger in the javaee-api.

javaee-api

javaee-web-api

这篇关于javaee-api 和 javaee-web-api 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆