01 javaee overview
TRANSCRIPT
-
8/14/2019 01 JavaEE Overview
1/40
1Copyright 2007, Oracle. All rights reserved.
Java EE: Overview
-
8/14/2019 01 JavaEE Overview
2/40
1-2 Copyright 2007, Oracle. All rights reserved.
Objectives
After completing this lesson, you should be able to do
the following:
Describe the Java Platform, Enterprise Edition
(Java EE) platform Define the components of Java EE
Identify the deployment options for a Java EE
application Describe the architecture of Oracle Application
Server Containers for Java EE (OC4J) Describe the directory structure and the uses of
the configuration files of OC4J List the security options available in Java EE
applications
-
8/14/2019 01 JavaEE Overview
3/40
1-3 Copyright 2007, Oracle. All rights reserved.
Java Platform, Enterprise Edition
The Java Platform, Enterprise Edition (Java EE) is a
standard for developing and implementing
enterprisewide applications:
It provides multitier applications support. It is designed to help improve the process of
developing, deploying, and implementing
enterprisewide applications.
-
8/14/2019 01 JavaEE Overview
4/40
1-4 Copyright 2007, Oracle. All rights reserved.
Java EE Platform
Multitiered, distributed application model
Supports component-based Java EE applications
Distributes the application logic to the appropriate
tier on the multitiered architecture
-
8/14/2019 01 JavaEE Overview
5/40
1-5 Copyright 2007, Oracle. All rights reserved.
Distributed Multitiered Applications
Java EE Application 1
Application Client
Java EE Application 2
Dynamic HTML Pages
Client tier
JSP Pages
Enterprise Beans Enterprise Beans
Web tier
Business tier
EIS tier
Client
Machine
Database
Server
Java EE
Server
-
8/14/2019 01 JavaEE Overview
6/40
-
8/14/2019 01 JavaEE Overview
7/401-7 Copyright 2007, Oracle. All rights reserved.
-
8/14/2019 01 JavaEE Overview
8/401-8 Copyright 2007, Oracle. All rights reserved.
Benefits of the Java EE Platform
Write once, run anywhere provides simplified
component development.
Multiple server products and vendors support the
Java EE standard, thus giving more deploymentchoices.
Integration with legacy systems through standardAPIs is possible.
Java EE separates client requirements from
business logic. It provides multiple development and design
scenarios.
It allows multiple clients to share server businesslogic.
-
8/14/2019 01 JavaEE Overview
9/401-9 Copyright 2007, Oracle. All rights reserved.
Benefits of the Java EE Platform
Java EE separates development tasks into specific
skill areas:
Web designers create JSF components.
Java programmers and business experts createbusiness logic and rules.
Production environment teams handle assembly
and deployment.
-
8/14/2019 01 JavaEE Overview
10/401-10 Copyright 2007, Oracle. All rights reserved.
Java EE Components
Java EE applications are made up of components. A
component:
Is an application-level software unit
Can be easily updated as business needs change Is reusable
There are several types of components:
Client-side components
Web components Business-tier components
-
8/14/2019 01 JavaEE Overview
11/401-11 Copyright 2007, Oracle. All rights reserved.
Java EE 5.0 Components
The Java EE 5.0 Specification lists the following
components:
Java Servlet 2.5
JavaServer Pages 2.1 Enterprise
JavaBeans 3.0
Java API for XML-based
Web Services 2.0
Java API for XML-based
RPC 1.1
Web Service Metadata
for the Java Platform
Java Message Service API
Java Transaction API Java Persistence API
J2EE Connector
Architecture 1.5
SOAP with AttachmentsAPI for Java (SAAJ)
Streaming API for XML
-
8/14/2019 01 JavaEE Overview
12/401-12 Copyright 2007, Oracle. All rights reserved.
Business-Tier Components
Business-tier components:
Are EJBs
Handle business logic
Receive data from client programs Retrieve data from database storage
Process the data and communicate with the
database and the client program
Can be invoked by the Web-tier components
-
8/14/2019 01 JavaEE Overview
13/401-13 Copyright 2007, Oracle. All rights reserved.
Enterprise JavaBeans (EJB)
Enterprise JavaBeans:
Are server-side components written in Java
Contain the business logic of an enterprise
application Are hosted in EJB containers
Are based on Remote Method Invocation (RMI)
communication
Are platform independent Provide remote services for clients
Can be exposed as Web services
Use JDBC to connect to a database
-
8/14/2019 01 JavaEE Overview
14/401-14 Copyright 2007, Oracle. All rights reserved.
-
8/14/2019 01 JavaEE Overview
15/401-15 Copyright 2007, Oracle. All rights reserved.
Types of EJB
Entity Bean
Used to model the persistence part of an
application
Session Bean Invoked by a client to perform a specific business
operation
Message-driven Bean
Triggered by messages sent to a messaging server,
which enables sending asynchronousmessages between system components
-
8/14/2019 01 JavaEE Overview
16/401-16 Copyright 2007, Oracle. All rights reserved.
Java Persistence API
The Java Persistence API (JPA) deals with:
The way relational data is mapped to Java objects
(persistent entities)
The way these objects are stored in a relationaldatabase so that they can be accessed at a later
time
The continued existence of an entitys state even
after the application that uses it, ends
-
8/14/2019 01 JavaEE Overview
17/401-17 Copyright 2007, Oracle. All rights reserved.
Web Services
Web services are Web-based enterprise
applications that use open XML-based standards
and transport protocols to exchange data with
calling clients.
The Java EE platform provides the XML APIs and
tools needed to design, develop, test, and deploy
Web services and clients that fully interoperate
with other Web services and clients running on
Java-based or non-Java-based platforms.
-
8/14/2019 01 JavaEE Overview
18/401-18 Copyright 2007, Oracle. All rights reserved.
Client-Tier Components
A Web browser:
Is used for a Web-based Java EE application
Downloads static or dynamic Web pages fromWeb-tier components
Is a thin client
An application client:
Is used for a non-browser-based Java EEapplication
Executes on the client machine Can contain a graphical or command-line interface
Is a thick client
Accesses middle-tier services
Requires installation on the client machine
-
8/14/2019 01 JavaEE Overview
19/401-19 Copyright 2007, Oracle. All rights reserved.
Java EE Web-Tier Components
A Web tier may consist of:
Java servlets
JavaServer Pages (JSPs)
JavaServer Faces (JS`Fs) Servlets and JSPs:
Work on a request-response model
Generate HTML dynamically
Access the database through JDBC
Access the business-tier components Handle user-centric events, such as an HREF link or
form submission
Usually generate visual interfaces, such as a Web
page
-
8/14/2019 01 JavaEE Overview
20/401-20 Copyright 2007, Oracle. All rights reserved.
-
8/14/2019 01 JavaEE Overview
21/401-21 Copyright 2007, Oracle. All rights reserved.
Client info (host name,
form data)
Success or failure
Process results
(access database)
Format results and produce
HTML
Send page back to client
Browser Servlet
What Is a Servlet?
Request
Response
-
8/14/2019 01 JavaEE Overview
22/401-22 Copyright 2007, Oracle. All rights reserved.
What Is a JavaServer Page?
A JavaServer Page (JSP):
Is a text-based document that includes:
HTML
JSP tags Java code (including calls to JavaBeans
and servlets)
Cleanly separates content creation from
presentation logic
Focuses on rapid development and easy
modification of the user interface
Focuses on presentation
-
8/14/2019 01 JavaEE Overview
23/401-23 Copyright 2007, Oracle. All rights reserved.
What Is JavaServer Faces?
JavaServer Faces (JSF):
Is a server-side component framework for Web
applications
Implements the Model-View-Controller (MVC)framework
Provides separation of navigational and data flow
Is built for rapid application development (RAD)
style development
-
8/14/2019 01 JavaEE Overview
24/401-24 Copyright 2007, Oracle. All rights reserved.
Web-Tier Components: Summary
Web-tier components generate dynamic content.
Servlets:
Extend Web server functionality
Are best used for business logic JSPs:
Combine HTML (or other markup) and Java
Are best used for presentation logic
JSFs:
Are component based
Implement MVC
-
8/14/2019 01 JavaEE Overview
25/401-25 Copyright 2007, Oracle. All rights reserved.
Java EE Communication APIs
Java EE provides component communication
through APIs that include:
Remote Method Invocation (RMI)
Java Naming and Directory Interface (JNDI)
Java Database Connectivity (JDBC)
These APIs facilitate communication:
Between the Java EE components
With the database
Java Message Service (JMS) enables components
to create, send, receive, and read messages.
-
8/14/2019 01 JavaEE Overview
26/40
1-26 Copyright 2007, Oracle. All rights reserved.
Java EE Server
The Java EE server provides:
Containers for each component type of a Java EE
application
System-level services to components: Naming and directory services (JNDI)
Security services for Web components and EJBs
(JAAS)
Transaction architecture (JTA)
Remote client connectivity:
Enterprise beans (RMI/IIOP, ORMI)
Servlet/JSP (HTTP, HTTPS, FTP)
-
8/14/2019 01 JavaEE Overview
27/40
1-27 Copyright 2007, Oracle. All rights reserved.
-
8/14/2019 01 JavaEE Overview
28/40
1-28 Copyright 2007, Oracle. All rights reserved.
Java EE Applications
Java EE applications consist of Java EE components
and are deployed in the form of modules:
Web modules contain the user interface: HTML,
JSP, and servlets.
EJB modules contain reusable EJB components.
Client modules provide access to remote
application code.
Packaging information identifies dependencies
between modules.
-
8/14/2019 01 JavaEE Overview
29/40
1-29 Copyright 2007, Oracle. All rights reserved.
Packaging Java EE Applications
Assembly
Root
META-INF
Web
Module
EJB
Module
Application
Client Module
Resource
Adapter Module
application.xml Ear File Structure
-
8/14/2019 01 JavaEE Overview
30/40
1-30 Copyright 2007, Oracle. All rights reserved.
Packaging Java EE
Application Components
4. ejb.jarClass files for enterprise beans and an
EJB deployment descriptor
1. webtier.warJava servlets, JSP files, HTML, GIF files, and
a Web application deployment descriptor
2. JavaEEappClient.jar
Java EE application client (Java class), andan application client deployment descriptor
3. Resource adapter (.rar)Java interfaces, classes, native libraries,
and other documentation and the resourceadapter deployment descriptor
Java EE application.ear
-
8/14/2019 01 JavaEE Overview
31/40
1-31 Copyright 2007, Oracle. All rights reserved.
Oracle Application Server Containers for
J2EE (OC4J)
OC4J is the Java EE server implementation in
Oracle Application Server 10g.
Key features:
Implements Java EE 1.4 Specification
Runs on standard JVM
Provides high performance and scalability
Is productive for developers to use
Is simple to manage and deploy
Provides clustering for high availability and failover
-
8/14/2019 01 JavaEE Overview
32/40
1-32 Copyright 2007, Oracle. All rights reserved.
OC4J Architecture
Web
container
JNDI
JMS
EJB
container
AJP13
ORMI
JDBC
JTA
JavaMail
JAF
mod_oc4j
Client
EJB client
Oracle HTTP
Server
ORMI
AJPHTTP
OC4J server process
JAAS
JCA
-
8/14/2019 01 JavaEE Overview
33/40
1-33 Copyright 2007, Oracle. All rights reserved.
Java EE Application Deployment to
Oracle Application Server 10g
Deploying to OC4J can be performed in multiple ways:
Step 2: Deploy
Use JDeveloper specify an
Application Server and click 'Deploy'
Step 1: Create WAR,EAR file
Step 2: Deploy
Use a command-line tool (such asANT).
Use JDeveloper.
Use Oracle Enterprise Manager(installed with Oracle Application
Server 10g): Access the Enterprise
Manager Web site
http://localhost:1810(requires login).
Use JDeveloper: Specify an
application server and click
Deploy.
-
8/14/2019 01 JavaEE Overview
34/40
1-34 Copyright 2007, Oracle. All rights reserved.
Security in Java EE Applications
Security for Java EE application components is
provided by their containers.
A container provides two types of security:
Declarative security through deployment
descriptors
Programmatic security embedded in the application
Annotations are used to specify information about
security within a class file.
-
8/14/2019 01 JavaEE Overview
35/40
1-35 Copyright 2007, Oracle. All rights reserved.
Using Deployment Descriptors for
Declarative Security
A deployment descriptor:
Is an XML document with an .xml extension
Is used by application developers to communicate
how security is to be set up for the deployedapplication
Enables an applications security structure,
including roles, access control and authentication
requirements to be expressed in a form external to
the application Is read at run time by the Java EE server which
then acts upon the application, module, or
component accordingly
-
8/14/2019 01 JavaEE Overview
36/40
1-36 Copyright 2007, Oracle. All rights reserved.
JDeveloper and Java EE
JDeveloper provides:
Integrated development, deployment, and testing
support for Web-tier and business-tier
components
A Java EE framework for rapid development
Application Development Framework (ADF)
business components
Data tags
Integration with Struts
UML modeling
Visual editors for Web clients
Easy deployment to Oracle Application Server 10g
JDeveloper
-
8/14/2019 01 JavaEE Overview
37/40
1-37 Copyright 2007, Oracle. All rights reserved.
Oracle JDeveloper 10gEnvironment
Wizards for
JSPs,
servlets, and
EJBs
Error
checking
for HTML
and JSPs
Code Insight
EAR, WAR
deployment
to Java EE
server
Customizable Code Editor
-
8/14/2019 01 JavaEE Overview
38/40
1-38 Copyright 2007, Oracle. All rights reserved.
Oracle JDeveloper 10g
Visual Design Tools
Drag JSP and HTML
elements
Modify
values
in
Property
Inspector
Design in visual
or code views,
see revisions
-
8/14/2019 01 JavaEE Overview
39/40
1-39 Copyright 2007, Oracle. All rights reserved.
Summary
In this lesson, you should have learned that:
Java EE is a set of Java technologies that
supports end-to-end application development
Components are the foundation of the Java EEarchitecture
Business components (EJBs) are server-side
components that contain business logic
Web components (servlets, JSPs, and JSFs)
generate dynamic content
Applications can be built by using Oracle
JDeveloper 10gand deployed to a Java EE server,
such as Oracle Application Server 10g
-
8/14/2019 01 JavaEE Overview
40/40