文章目录
Java EE 官方文档记录
此博文记录Java EE8官方文档的一些阅读总结
文档地址
有意思的话
现实:
In the world of information technology, enterprise applications must be designed, built, and produced for less money, with greater speed, and with fewer resources
Java EE 的组件
The Java EE specification defines the following Java EE components:
- Application clients and applets are components that run on the client.
- Java Servlet, JavaServer Faces, and JavaServer Pages (JSP) technology components are web components that run on the server.
- EJB components (enterprise beans) are business components that run on the server
Java EE container
Containers are the interface between a component and the low-level, platform-specific functionality that supports the component.
Before it can be executed, a web, enterprise bean, or application client component must be assembled into a Java EE module and deployed into its container
The container also manages nonconfigurable services, such as enterprise bean and servlet lifecycles, database connection resource pooling, data persistence, and access to the Java EE platform APIs
Web Container
A web container provides such services as request dispatching, security, concurrency, and lifecycle management
JSF
In JSF 2.3, managed bean annotations are deprecated; CDI is now the preferred approach.
RESTful Web Services
The REST architectural style is designed to use a stateless communication protocol, typically HTTP. In the REST architecture style, clients and servers exchange representations of resources by using a standardized interface and protocol.
EJB
Written in the Java programming language, an enterprise bean is a server-side component that encapsulates the business logic of an application.
JPA
An entity is a lightweight persistence domain object. Typically, an entity represents a table in a relational database, and each entity instance corresponds to a row in that table
Security
A realm is a complete database of users and groups identified as valid users of one or more applications and controlled by the same authentication policy.
A principal is an entity that can be authenticated by an authentication protocol in a security service that is deployed in an enterprise. A principal is identified by using a principal name and authenticated by using authentication data.
A credential is an object that contains or references security attributes used to authenticate a principal for Java EE services. A principal acquires a credential upon authentication or from another principal that allows its credential to be used
When you design an enterprise bean or web component, you should always think about the kinds of users who will access the component
CDI
Beans that use session, application, or conversation scope must be serializable, but beans that use request scope do not have to be serializable.
JTA
The Java™ Transaction API (JTA) allows applications to perform distributed transactions, that is, transactions that access and update data on two or more networked computer resources
常见用语
- Java EE - Java Enterprise Edition - Java企业版
- Java SE - Java Standard Edition - Java标准版
- Java Specification Requests - JSR - Java规范要求
- Enterprise JavaBeans - EJB - 企业级 Java bean
- Enterprise information system - EIS -企业信息系统,这里通常指 存储数据的地方,如DB
- Graphical User Interface - GUI - 图形用户界面
- Java Persistence API - JPA
- Java Transaction API - JTA
- Java API for RESTful Web Services - JAX-RS
- Contexts and Dependency Injection for Java EE - CDI
- Java Archive - JAR
- Web Archive - WAR
- Enterprise Archive -EAR
- World Wide Web Consortium - W3C -万维网联盟
- Uniform Resource Identifiers - URI
- Java Persistence Query Language - JPQL
值得读的章节
Java EE 体系
JSF部分
CDI部分
Web Services部分
JAXRS部分
EJB部分
JPA部分
Java EE Security 部分
问题记录
Windows下Tomca启动乱码
这是因为Windows下编码应该设置为GBK
- 进入tomcat安装路径中的conf文件夹
- 打开logging-properties文件
- 找到java.util.logging.ConsoleHandler.encoding = UTF-8 ,将其中的UTF-8改为GBK
- 保存退出
- 再次启动即可
Windows下安装多个Tomcat
直接下载自己需要的版本即可
Windows下安装多个Tomcat的问题
一般安装完Tomcat之后,我们会设置环境变量。如果是多个Tomcat,那么Tomcat所对应的环境变量也应该是多个。否则的话,多个Tomcat的启动脚本拿到的环境变量都是同一个
解决方案
只需要把启动脚本里的取值改了即可.详细步骤参考这里
Windows下运行Java EE项目
最直接的办法就是下载一个Tomcat EE,在IDEA中配置即可.不要使用Tomcat,配置起来相当麻烦,还会有各种各样的问题
Hibernate
https://www.cnblogs.com/sundaysjava/p/10328299.html
资源
JavaEE的一些例子
有意思的思考?
RESTFul中POST和PUT如何抉择?
高赞回答.大致理解为当你想对资源进行的操作是幂等的时候,用PUT。如果想对资源的操作不是幂等的时候,用POST。并不是,POST用于创建资源,PUT用于修改资源,或者,PUT用于创建资源,POST用于修改资源。这两种说法都不对