.net人员用Java 之Java EE

简介: 上篇文章对Java的基本概念作了简要总结(http://www.cnblogs.com/2018/archive/2011/04/05/1993163.html),本文把对java EE的学习过程总结一下。

上篇文章对Java的基本概念作了简要总结(http://www.cnblogs.com/2018/archive/2011/04/05/1993163.html),本文把对java EE的学习过程总结一下。

基础

https://javaeetutorial.dev.java.net/files/documents/7232/141115/javaeetutorial6.zip

这个里面有介绍文档和例子代码,这些例子在netbeans可直接打开,参考文档部署和运行

这个文档介绍了整个Java EE的基本概念和示范例子,熟悉这个基本对Java EE的概念就比较了解了。

Java EE的基本概念

实际的开发中,只要理解了下面的几个图表和规范,只要针对具体的规范和标准进行学习即可。因为本身Java EE规范范围很大,我们实际中用的只是其中的部分。

【以下是做的一些图书资料记录,我认为很重要】

Java EE is based on standards.

Containers are Java EE runtime environments that provide certain services to the components they host such as life-cycle management, dependency injection, and so on. These components use well-defined contracts to communicate with the Java EE infrastructure and with the other components.

 

containers

Applet containers are provided by most web browsers to execute applet components. When you develop applets, you can concentrate on the visual aspect of the application while the container givesou a secure environment. The applet container uses a sandbox security model where code executed inhe “sandbox” is not allowed to “play outside the sandbox.” This means that the container prevents anyode downloaded to your local computer from accessing local system resources, such as processes oriles.

The application client container (ACC) includes a set of Java classes, libraries, and other files required to bring injection, security management, and naming service to Java SE applications (Swing,atch processing, or just a class with a main() method). ACC communicates with the EJB container usingRMI-IIOP and the web container with HTTP (e.g., for web services).

The web container provides the underlying services for managing and executing web componentsservlets, EJBs Lite, JSPs, filters, listeners, JSF pages, and web services). It is responsible for instantiating,nitializing, and invoking servlets and supporting the HTTP and HTTPS protocols. It is the containersed to feed web pages to client browsers.

The EJB container is responsible for managing the execution of the enterprise beans containing theusiness logic tier of your Java EE application. It creates new instances of EJBs, manages their life cycle, and provides services such as transaction, security, concurrency, distribution, naming service, or theossibility to be invoked asynchronously.

image

Services

Containers provide underlying services to their deployed components.

Java Transaction API (JTA): This service offers a transaction demarcation API usedby the container and the application. It also provides an interface between thetransaction manager and a resource manager at the Service Provider Interface(SPI) level.

Java Persistence API (JPA): Standard API for object-relational mapping (ORM). With its Java Persistence Query Language (JPQL), you can query objects stored in the underlying database.

Validation: Bean Validation provides a class level constraint declaration and validation facility.

Java Message Service (JMS): This allows components to communicate asynchronously through messages. It supports reliable point-to-point (P2P) messaging as well as the publish-subscribe (pub-sub) model.

Java Naming and Directory Interface (JNDI): This API, included in Java SE, is used to access naming and directory systems. Your application uses it to associate (bind) names to objects and then to find these objects (lookup) in a directory. You can look up datasources, JMS factories, EJBs, and other resources. Omnipresent in your code until J2EE 1.4, JNDI is used in a more transparent way through injection.

JavaMail: Many applications require the ability to send e-mails, which can be implemented through use of the JavaMail API.

JavaBeans Activation Framework (JAF): The JAF API, included in Java SE, provides a framework for handling data in different MIME types. It is used by JavaMail.

XML processing: Most Java EE components can be deployed with optional XML deployment descriptors, and applications often have to manipulate XML documents. The Java API for XML Processing (JAXP) provides support for parsing documents with SAX and DOM APIs, as well as for XSLT. The Streaming API for XML (StAX) provides a pull-parsing API for XML.

• Java EE Connector Architecture (JCA): Connectors allow you to access EIS from a Java EE component. These could be databases, mainframes, or Enterprise Resource Planning (ERP) programs.

• Security services: Java Authentication and Authorization Service (JAAS) enables services to authenticate and enforce access controls upon users. The Java Authorization Service Provider Contract for Containers (JACC) defines a contract between a Java EE application server and an authorization service provider, allowing custom authorization service providers to be plugged into any Java EE product.

• Web services: Java EE provides support for SOAP and RESTful web services. The Java API for XML Web Services (JAX-WS), replacing the Java API for XML-based RPC (JAX-RPC), provides support for web services using the SOAP/HTTP protocol. The Java API for RESTful Web Services (JAX-RS) provides support for web services using the REST style.

• Dependency injection: Since Java EE 5, some resources (datasources, JMS factories, persistence units, EJBs…) can be injected in managed components. Java EE 6 goes further by using CDI (Context and Dependency Injection) as well as the DI (Dependency Injection for Java) specifications.

• Management: Java EE defines APIs for managing containers and servers using a special management enterprise bean. The Java Management Extensions (JMX) API is also used to provide some management support.

• Deployment: The Java EE Deployment Specification defines a contract between deployment tools and Java EE products to standardize application deployment.

clip_image002

image

参考资料

Java EE 6规范中文版.chm

Java+EE+6+API+Specifications.CHM

javadocee6.zip

servlet-2_3-fcs-docs.zip

javaeetutorial6.zip[The Java EE 6Tutorial]

The Java EE 6 Tutorial Basic Concepts, 4th Edition

Beginning Java EE 6 with GlassFish 3, 2nd Edition

这些资料在网上都可以找到

例子实战

http://netbeans.org/kb/docs/javaee/ecommerce/design.html

很实用的一个例子,覆盖了多个方面的内容,理解了这个基本对如何实施一个Java EE的项目就有一个比较清晰的概念了。

Java EE发展了十几年,相关的资料和开源框架等浩如烟海,我们只要把握这些基础的概念,然后结合相应的实例学习和开发改造,在项目中就可以顺利应用了。

相关文章
|
5天前
|
存储 缓存 前端开发
JavaEE初阶——初识EE(Java诞生背景,CPU详解)
带你从零入门JAVAEE初阶,Java的发展历程认识什么是cpu,cpu的工作原理,cpu是如何进行计算的,cpu的架构,指令集,cpu的核心,如何提升cpu的算力,cpu的指令,,cup的缓存,cpu的流水线
|
1月前
|
前端开发 Java 数据库连接
你不可不知道的JAVA EE 框架有哪些?
本文介绍了框架的基本概念及其在编程领域的应用,强调了软件框架作为通用、可复用的软件环境的重要性。文章分析了早期Java EE开发中使用JSP+Servlet技术的弊端,包括可维护性差和代码重用性低等问题,并阐述了使用框架的优势,如提高开发效率、增强代码规范性和可维护性及提升软件性能。最后,文中详细描述了几种主流的Java EE框架,包括Spring、Spring MVC、MyBatis、Hibernate和Struts 2,这些框架通过提供强大的功能和支持,显著提升了Java EE应用的开发效率和稳定性。
95 1
|
1月前
|
Java 网络安全 Maven
Exception in thread "main" java.lang.NoSuchMethodError: okhttp3.OkHttpClient$Builder.sslSocketFactory(Ljavax/net/ssl/SSLSocketFactory;Ljavax/net/ssl/X509TrustManager;)Lokhttp3/OkHttpClient$Builder; 问题处理
【10月更文挑战第26天】Exception in thread "main" java.lang.NoSuchMethodError: okhttp3.OkHttpClient$Builder.sslSocketFactory(Ljavax/net/ssl/SSLSocketFactory;Ljavax/net/ssl/X509TrustManager;)Lokhttp3/OkHttpClient$Builder; 问题处理
45 2
|
5月前
|
网络协议 Java Apache
【Java】已解决java.net.HttpRetryException异常
【Java】已解决java.net.HttpRetryException异常
144 0
|
5月前
|
网络协议 Java
【Java】已解决java.net.UnknownHostException异常
【Java】已解决java.net.UnknownHostException异常
1130 0
|
1月前
|
Java 数据库连接 API
Spring 框架的介绍(Java EE 学习笔记02)
Spring是一个由Rod Johnson开发的轻量级Java SE/EE一站式开源框架,旨在解决Java EE应用中的多种问题。它采用非侵入式设计,通过IoC和AOP技术简化了Java应用的开发流程,降低了组件间的耦合度,支持事务管理和多种框架的无缝集成,极大提升了开发效率和代码质量。Spring 5引入了响应式编程等新特性,进一步增强了框架的功能性和灵活性。
49 0
|
4月前
|
算法 Java 测试技术
java 访问ingress https报错javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version
java 访问ingress https报错javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version
|
4月前
|
Java 开发工具 Spring
【Azure Spring Cloud】使用azure-spring-boot-starter-storage来上传文件报错: java.net.UnknownHostException: xxxxxxxx.blob.core.windows.net: Name or service not known
【Azure Spring Cloud】使用azure-spring-boot-starter-storage来上传文件报错: java.net.UnknownHostException: xxxxxxxx.blob.core.windows.net: Name or service not known
|
5月前
|
开发框架 安全 Java
.net和java有什么样的区别?
Java和.NET在本质、编程语言、生态系统与工具、跨平台性、应用领域、性能与效率以及安全性与可靠性等方面都存在明显的区别。选择哪个平台取决于具体的需求、技术栈和目标平台。
330 7
|
6月前
|
网络协议 Java 程序员
TCP/IP协议栈是网络通信基础,Java的`java.net`包提供工具,使开发者能利用TCP/IP创建网络应用
【6月更文挑战第23天】 **TCP/IP协议栈是网络通信基础,它包含应用层(HTTP, FTP等)、传输层(TCP, UDP)、网络层(IP)、数据链路层(帧, MAC地址)和物理层(硬件信号)。Java的`java.net`包提供工具,使开发者能利用TCP/IP创建网络应用,如Socket和ServerSocket用于客户端和服务器通信。**
58 3