Skip to content
JackSparrow414
Go back

Reading the Java EE Official Documentation

Table of contents

Open Table of contents

Reading Notes on the Official Java EE Documentation

This post records some reading notes from the official Java EE 8 documentation.

  1. Java EE 8

Interesting Quotes

Reality:

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 Components

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

Common Terms

Chapters Worth Reading

Java EE Architecture

JSF

CDI

Web Services

JAX-RS

EJB

JPA

Java EE Security

Issues Encountered

Garbled Output When Starting Tomcat on Windows

This happens because on a Chinese-locale Windows system, the console encoding should be set to GBK.

  1. Go to the conf folder in the Tomcat installation directory
  2. Open the logging-properties file
  3. Find java.util.logging.ConsoleHandler.encoding = UTF-8 and change the UTF-8 in it to GBK
  4. Save and exit
  5. Start it again and you’re done

Installing Multiple Tomcat Instances on Windows

Just download the versions you need.

Issues with Installing Multiple Tomcat Instances on Windows

After installing Tomcat, we usually set environment variables. With multiple Tomcat instances, each Tomcat should have its own corresponding environment variables. Otherwise, the startup scripts of all the Tomcat instances pick up the same environment variables.

Solution

You just need to change the value read in the startup script. For detailed steps, see here.

Running Java EE Projects on Windows

The most straightforward approach is to download a Tomcat EE and configure it in IDEA. Don’t use Tomcat — it’s quite troublesome to configure, and you’ll run into all kinds of problems.

Hibernate

https://www.cnblogs.com/sundaysjava/p/10328299.html

Resources

Some Java EE Examples

  1. All the examples on the TomEE website
  2. Good Java EE 8 examples on GitHub

Interesting Thoughts?

How to Choose Between POST and PUT in RESTful?

The highly upvoted answer. My rough understanding: use PUT when the operation you want to perform on the resource is idempotent, and POST when the operation on the resource is not idempotent. It’s not “POST is for creating resources, PUT is for modifying resources,” nor “PUT is for creating resources, POST is for modifying resources.” Both of these claims are wrong.


Share this post:

Previous Post
Basic Ehcache Usage
Next Post
Getting Started with JWT and nimbus-jose-jwt

Comments

Questions, corrections, and experiences are welcome. Sign in with GitHub to comment; both language versions share this discussion.

Comments are available on the live site only.