国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php框架 > 框架设计 > Java EE 7 教程 第一部分 简介 第1章 概述 第1.7节 Java EE 7 APIs

Java EE 7 教程 第一部分 简介 第1章 概述 第1.7节 Java EE 7 APIs

来源:程序员人生   发布时间:2015-01-04 09:40:55 阅读次数:4156次

原文:http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

翻译:石卓林 shizhuolin@hotmail.com

注意:此章是1.8章前移而来,不知为什么oracle删除原1.7开发角色章节

1.7 Java EE 7 APIs

Figure 1⑹ shows the relationships among the Java EE containers.

Figure 1⑹ Java EE Containers

Java EE Containers

Description of "Figure 1⑹ Java EE Containers"

Figure 1⑺ shows the availability of the Java EE 7 APIs in the web container.

Figure 1⑺ Java EE APIs in the Web Container

Java EE APIs in the Web Container

Description of "Figure 1⑺ Java EE APIs in the Web Container"

Figure 1⑻ shows the availability of the Java EE 7 APIs in the EJB container.

Figure 1⑻ Java EE APIs in the EJB Container

Java EE APIs in the EJB Container

Description of "Figure 1⑻ Java EE APIs in the EJB Container"

Figure 1⑼ shows the availability of the Java EE 7 APIs in the application client container.

Figure 1⑼ Java EE APIs in the Application Client Container

Java EE APIs in the Application Client Container

Description of "Figure 1⑼ Java EE APIs in the Application Client Container"

The following sections give a brief summary of the technologies required by the Java EE platform and the APIs used in Java EE applications.

1.7 Java EE 7 APIs

图 1⑹ 显示了Java EE容器之间的关系.

图 1⑹ Java EE 容器

Java EE 容器

"图 1⑹ Java EE 容器"简介

图 1⑺ 显示了在web容器中可使用的Java EE 7 APIs.

图 1⑺ Web容器中的 Java EE APIs

Web容器中的 Java EE APIs

"图 1⑺ Web容器中的 Java EE APIs"简介

图 1⑻ 显示了在EJB容器中可用的Java EE 7 APIs.

图 1⑻ EJB容器中的Java EE APIs

EJB容器中的Java EE APIs

"图 1⑻ EJB容器中的Java EE APIs"简介

图 1⑼显示了在利用客户端容器中可用的Java EE 7 APIs.

图 1⑼ 利用客户端容器中的Java EE 7 APIs

应用客户端容器中的Java EE 7 APIs

"图 1⑼ 利用客户端容器中的Java EE 7 APIs"简介

以下章节扼要叙述了Java EE平台所需技术和Java EE利用中使用的APIs.

1.7.1 Enterprise JavaBeans Technology

An Enterprise JavaBeans (EJB) component, or enterprise bean, is a body of code that has fields and methods to implement modules of business logic. You can think of an enterprise bean as a building block that can be used alone or with other enterprise beans to execute business logic on the Java EE server.

Enterprise beans are either session beans or message-driven beans.

  • A session bean represents a transient conversation with a client. When the client finishes executing, the session bean and its data are gone.
  • A message-driven bean combines features of a session bean and a message listener, allowing a business component to receive messages asynchronously. Commonly, these are Java Message Service (JMS) messages.

In the Java EE 7 platform, new enterprise bean features include the following:

  • Asynchronous local session beans in EJB Lite
  • Nonpersistent timers in EJB Lite

The Java EE 7 platform requires Enterprise JavaBeans 3.2 and Interceptors 1.2. The Interceptors specification is part of the EJB specification.

1.7.1 企业JavaBeans技术

1个 企业JavaBeans (EJB)组件企业bean是1段代码,其有业务逻辑实行模块的字段和方法.你可以认为1个企业bean是1个积木构件,它能被单独使用或作为其他Java EE服务器上的企业beans履行业务逻辑.

企业bean是会话bean或消息驱动bean:

  • 会话bean代表与客户真个1次短暂会话. 当客户端履行终了, 会话bean和其数据都会消失.
  • 消息驱动 bean 结合了消息监听器和会话bean的功能, 语序业务组件接收异步消息,通常是Java消息服务(JMS)消息.

在Java EE 7平台中,企业bean包括以下新功能:

  • 在EJB精简版中的异步本地会话bean
  • 在EJB精简版中的非持久性计时器

Java EE 7平台要求企业JavaBeans 3.2和Interceptors(拦截器) 1.2. 该拦截器规范是EJB规范的1部份.

1.7.2 Java Servlet Technology

Java Servlet technology lets you define HTTP-specific servlet classes. A servlet class extends the capabilities of servers that host applications accessed by way of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers.

In the Java EE 7 platform, new Java Servlet technology features include the following:

  • Nonblocking I/O
  • HTTP protocol upgrade

The Java EE 7 platform requires Servlet 3.1.

1.7.2 Java Servlet 技术

Java Servlet技术允许你定义基于HTTP规范的servlet类. servlet类作为服务器的功能延伸, 允许通过要求-响应编程模型的方式访问主机. Although 虽然servlet可以对任何类型的要求作出响应, 但他们通常被用于扩大web服务器托管的利用程序.

在Java EE 7平台中, Java Servlet技术包括以下新功能:

  • 非阻塞 I/O
  • HTTP协议升级

Java EE 7平台要求Servlet 3.1.

1.7.3 JavaServer Faces Technology

JavaServer Faces technology is a user interface framework for building web applications. The main components of JavaServer Faces technology are as follows:

  • A GUI component framework.
  • A flexible model for rendering components in different kinds of HTML or different markup languages and technologies. A Renderer object generates the markup to render the component and converts the data stored in a model object to types that can be represented in a view.
  • A standard RenderKit for generating HTML 4.01 markup.

The following features support the GUI components:

  • Input validation
  • Event handling
  • Data conversion between model objects and components
  • Managed model object creation
  • Page navigation configuration
  • Expression Language (EL)

All this functionality is available using standard Java APIs and XML-based configuration files.

In the Java EE 7 platform, new features of JavaServer Faces technology include the following:

  • HTML5-friendly markup
  • Faces Flows
  • Resource library contracts

The Java EE 7 platform requires JavaServer Faces 2.2 and Expression Language 3.0.

1.7.3 JavaServer Faces 技术

JavaServer Faces 技术是用于构建web利用的UI框架. 以下是JavaServer Faces技术的主要组成部份:

  • 1个GUI(图形用户界面)组件框架.
  • 1个可以在不同类型HTML或不同的标记语言和技术实现中渲染的弹性组件模型. 通过渲染对象为标记来显示组件并转换模型对象的存储数据为可在视图中显示的类型.
  • 1个用于生成HTML 4.01标记的标准渲染工具包

GUI组件支持以下功能:

  • 输入校验
  • 事件处理
  • 模型对象和组件之间的数据转换
  • 管理的模型对象的创建
  • 配置页面导航
  • 表达式语言(EL)

所有功能可使用标准的Java API或基于XML的配置文件.

在Java EE 7平台中, JavaServer Faces技术包括以下新功能:

  • 友好HTML5标记
  • 瀑布流
  • 资源库契约

Java EE 7平台要求JavaServer Faces 2.2和Expression Language 3.0.

1.7.4 JavaServer Pages Technology

JavaServer Pages (JSP) technology lets you put snippets of servlet code directly into a text-based document. A JSP page is a text-based document that contains two types of text:

  • Static data, which can be expressed in any text-based format, such as HTML or XML
  • JSP elements, which determine how the page constructs dynamic content

For information about JSP technology, see the The Java EE 5 Tutorial at http://docs.oracle.com/javaee/5/tutorial/doc/.

The Java EE 7 platform requires JavaServer Pages 2.3 for compatibility with earlier releases but recommends the use of Facelets as the display technology in new applications.

1.7.4 JavaServer页面技术

JavaServer Pages (JSP) 技术让你可以在基于文本的文档中嵌入servlet代码片断. JSP页面是基于文本的文档,其包括两种文本类型:

  • 静态数据, 可以表达任意文本格式, 例如HTML或XML
  • JSP元素, 用其构建包括动态内容的页面

关于JSP技术的信息可以查看Java EE 5教程 at http://docs.oracle.com/javaee/5/tutorial/doc/.

Java EE 7 平台为兼容初期版本要求JavaServer Pages 2.3,但推荐在新利用中使用Facelets显示技术.

1.7.5 JavaServer Pages Standard Tag Library

The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many JSP applications. Instead of mixing tags from numerous vendors in your JSP applications, you use a single, standard set of tags. This standardization allows you to deploy your applications on any JSP container that supports JSTL and makes it more likely that the implementation of the tags is optimized.

JSTL has iterator and conditional tags for handling flow control, tags for manipulating XML documents, internationalization tags, tags for accessing databases using SQL, and tags for commonly used functions.

The Java EE 7 platform requires JSTL 1.2.

1.7.5 JavaServer页面标准标签库

JavaServer页面标准标签库(JSTL)封装多数JSP利用中常见的核心功能. 这样就不需要在你的JSP利用中混合使用来自不同厂商的各种标签. 它是单1的,标准的,标签集合. 这类标准化允许你部署利用到支持JSTL的任意JSP容器时感觉更容易,更容易对标签实现进行优化.

JSTL有用于处理控制流的迭代和条件标签, 用于操作XML文档的标签,国际化标签,通过SQL访问数据库的标签和经常使用功能标签.

Java EE 7平台要求JSTL 1.2.

1.7.6 Java Persistence API

The Java Persistence API (JPA) is a Java standards

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生