Sie sind auf Seite 1von 27

J2EE Overview

Version 1.0.
Course Objective
•The Objective of J2EE course are:
– To understand multi-tiered enterprise
applications.
– To understand J2EE framework for
developing enterprise applications.
– To understand various components of
J2EE like JSP, Servlets, EJB etc. and
effectively use them.
– To understand Application Server and its
configurations.
– To learn and deploy web based
applications in application server.
– To learn supporting technologies like
TCS Internal September 3, 2009
What is WWW
•The WWW incorporates all of the Internet
services above and much more.
•You can retrieve documents, view images,
animation, and video, listen to sound files,
speak and hear voice, and view programs
that run on practically any software in the
world, provided your computer has the
hardware and software to do these things.

TCS Internal September 3, 2009


How does WWW work

TCS Internal September 3, 2009


HTTP
•HTTP defines the requests that a client can
send to a server and responses that the
server can send in reply
•Each request contains a URL, which is a
string that identifies a Web component or a
static object such as an HTML page or image
file.

TCS Internal September 3, 2009


HTTP Communication

TCS Internal September 3, 2009


HTTP Commands
•GET - retrieves the resource identified by
the request URL.
•HEAD - returns the headers identified by
the request URL.
•POST - sends data of unlimited length to
the Web server.
•PUT - stores a resource under the request
URL.
•DELETE - removes the resource identified
by the request URL.
•OPTIONS - returns the HTTP methods the
server supports.
•TRACE - returns the header fields sent with
the TRACE request.
TCS Internal September 3, 2009
HTTP Request
•An HTTP request is sent by the browser to
server. It will have the command, the
requested object, protocol, and any
additional attribute passed along with the
object.
Eg: GET /reports/sales/index.html HTTP/1.0

Component/
Object Protocol/
Version
Command

TCS Internal September 3, 2009


HTTP Response
•An HTTP message sent by a server to a
client is called an HTTP response. The initial
line of an HTTP response is called the status
line.
•It has three parts, separated by spaces: the
HTTP version, a response status code that
tells the result of the request, and an
English phrase describing the status code.
HTTP/1.0 200 OK
Date: Tue, 01 Dec 2001 23:59:59 GMT
Content-Type: text/html
Content-Length: 52
<html>
<body>
<h1>Hello, John!</h1>
</body>
</html>
TCS Internal September 3, 2009
Web Application
•An obvious but still accurate definition of a
web application is that it is an application
that is accessible from the web!
•Normally, web server serves static content
only.
•To build a web application, we write small
programs on the server.
•When the user requests for this script, it is
executed on the server and the output
(which is a HTML file) is sent to the client.

TCS Internal September 3, 2009


J2EE
•Java 2 Platform, Enterprise Edition (J2EE)
defines the standard for developing
component-based multi-tier distributed
enterprise applications.
•A J2EE component is a self-contained
functional software unit that is assembled
into a J2EE application along with related
components.
•An enterprise-level platform for developing
portable, secure, scalable, distributed, multi-
tier business applications.

TCS Internal September 3, 2009


J2EE (contd.)
•Application logic is divided into components
according to function
•The various application components that
make up a J2EE application are installed on
different machines depending on the tier in
the multitiered J2EE environment to which
the application component belongs

TCS Internal September 3, 2009


J2EE Multi-tier Framework

Client Client
ANY CLIENT WEB CLIENT
Tier Machine

JSP/Servlet Web
Container Tier J2EE
Server
Business
EJB Container
Tier
Database
Database/Legacy Systems EIS Tier Server /
Legacy
Server

TCS Internal September 3, 2009


J2EE Architecture
CLIENTS J2EE WEB APPLICATION SERVER TIER BACK END
TIER TIER
PRESENTATION BUSINESS LOGIC
LOGIC (EJB Container )
External Clients (Web Components)
from INTERNET
(Browsers , WAP
etc.) Applets
SERVLETS EJB EJB

EJB EJB Enterprise


JSP
Information
Systems

EJB EJB (Databases,


XML ERP,
Legacy
Internal Clients Systems)
from INTRANET
(Browsers , Desk
top
Applications etc.)
ENTERPRISE SERVICES
Applets,
Javabeans
WML

JDBC JNDI JMS JTS

HTML
RMI - IIOP

TCS Internal September 3, 2009


J2EE offerings for Developer
Java Authentication & Enterprise Java
Authorization Service Beans

Java Naming & Java Servlet


Directory Interface Technology

JAXP – JAXB –
J2EE Java Server Pages
JAXR – JAXRPC

JDBC Java Message Service

Java Transaction API


SAAJ (Web Services) & Service
JTA + JTS
JavaMail API

TCS Internal September 3, 2009


J2EE Application Components
– J2EE applications comprises various
components.
•Client Components
– Built using applets which runs on
client machine
•Web Compoents
– Built using Java Servlet technology
and JSP technology which runs on
server.
•Business Compnents
– Built using EJB technolgy which
runs on server.

TCS Internal September 3, 2009


Web Components
•J2EE Web components can be either servlets
or JSP pages
•Servlets are Java programming language
classes that dynamically process requests
and construct responses.
•JSP pages are text-based documents that
execute as servlets but allow a more natural
approach to creating static content

TCS Internal September 3, 2009


Web Components (cont..)
•Static HTML pages and applets are bundled
with Web components during application
assembly, but are not considered Web
components by the J2EE specification.
•Server-side utility classes can also be
bundled with Web components and, like
HTML pages, are not considered Web
components.

TCS Internal September 3, 2009


Web Tier

TCS Internal September 3, 2009


Business Components
•Business code, which is logic that solves or
meets the needs of a particular business
domain such as banking, retail, or finance, is
handled by enterprise beans running in the
business tier.

TCS Internal September 3, 2009


Business Tier

TCS Internal September 3, 2009


EIS Tier
•The enterprise information system tier
handles enterprise information system
software and includes enterprise
infrastructure systems such as enterprise
resource planning (ERP), mainframe
transaction processing, database systems,
and other legacy information systems.

•Related API’s
– JCA , JDBC , JMS , Web Services etc

TCS Internal September 3, 2009


J2EE Containers
•What is a Container
– Containers are the interface between a
component and the low-level platform
specific functionality that supports the
component.
•How does it work
– Container settings are specified for each
component during assembly process before
deployment.
•What do I get
– Support for security, transaction
management, JNDI lookup, Remote
connectivity.
TCS Internal September 3, 2009
J2EE Containers (cont..)

–Manage life cycle of


objects
–Manage transactions
–Provide security
–Resource
optimization
•DB pooling
•Compiled JSP
Caching
–Persistence support
•CMP (EJB-QL)TCS Internal September 3, 2009
J2EE Roles & Responsibilities

•J2EE Product Provider


– Builds Compliant products
• IBM Websphere
•JBoss
•Application Component Provider
– Develops the application – jsp, servlet, ejb
etc.
•Application Assembler
– Resolves dependencies, Deliver deployable
app.
TCS Internal September 3, 2009
J2EE Roles & Responsibilities
(cont..)
•Deployer
– Configures resources
•DB, Roles, Users, etc.
•System Administrator / Production Support
– Runtime monitoring, Network
administration, Support
•Tool Provider
– Provides helper tools for managing,
deploying, developing, packaging.

TCS Internal September 3, 2009


Reference
•Stephanie Bodoff, et. al., The J2EE Tutorial,
Sun Microsystems.
•James Mc Govern, et. al., J2EE 1.4. Bible.

TCS Internal September 3, 2009

Das könnte Ihnen auch gefallen