J2EE Chris Hundersmarck Maria Baron Jeff Webb.  Java 2 Platform, Micro Edition (J2ME)  Java 2 Platform, Standard Edition (J2SE)  Java 2 Platform, Enterprise.

Slides:



Advertisements
Similar presentations
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
Advertisements

An architecture for webb applications, J2EE
G O B E Y O N D C O N V E N T I O N WORF: Developing DB2 UDB based Web Services on a Websphere Application Server Kris Van Thillo, ABIS Training & Consulting.
J2ME Web Services Specification.  With the promise to ease interoperability and allow for large scale software collaboration over the Internet by offering.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
Lecture 10: Web Services. Outline Overview of Web Services Create a Web Service with Sun J2EE (JAX-RPC)
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Layers & Tiers Umair Javed Lec - 41.
J2EE Java2 Enterprise Edition by Damian Borth. Contents Introduction Architectures styles Components Scenarios Roles Processing a HTTP request.
JAX-RPC The Java API for XML Remote Procedure Calls Notes from The J2EE Tutorial 1.4 From Sun Microsystems.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
CS 483 Enterprise and Web Application Programming
1 Java Server Programming zLecture 1 focuses on: yIntroduction to web services y Web Services using Axis y The bigger Picture: Introduction to J2EE y Java.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Distributed System Using Java 2 Enterprise Edition (J2EE)
INTRODUCING THE JAVA EE PLATFORM Ch-5. Introduction Java is a  platform-independent programming language  secure and robust applications  may run on.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
11. Java-Based Web: JSP, JSF. 2 Motto: Rule 1: Our client is always right Rule 2: If you think our client is wrong, see Rule 1. - Anonymous.
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
Web Services Mohamed Fahmy Dr. Sherif Aly Hussein.
1 l Enterprise Computing -- 3-tier and multi-tier applications l Enterprise JavaBeans n EJB Features n Types of EJBs l Example – A Currency Converter n.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
Notes of J2EE Tutorial Matt Tsai. 2 Outline Chapter 1: Overview Chapter 1: Overview Chapter 2: Understanding XML Chapter 2: Understanding XML Chapter.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Introduction to J2EE Architecture Portions by Kunal Mehta.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Java 2 Enterprise Edition Presented by: Reem Osama Shehata Supervised by: Dr. Sherif Aly 16 th March 2006.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
1 Java EE Programming Enterprise JavaBeans. 2 Topics J2EE Overview Enterprise JavaBeans Overview Enterprise Entity Beans Case Study How to build them.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
1 Distributed System using J2EE. 2 What is J2EE?  J2EE (Java2 Enterprise Edition) offers a suite of software specification to design, develop, assemble.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Apache Struts Technology A MVC Framework for Java Web Applications.
The Java API for XML-Based Web Services. A Web Service example in Java SOAP-awareServlet (e.g. Apache Axis2) SOAP-awareServlet Any class processing the.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Chapter 5 Remote Procedure Call
Introduction to Advanced Java Programming
Web Services-JAX-RPC JAX-RPC enables a Web Service endpoint to be developed using either a Java Servlet or Enterprise JavaBeans (EJB) component model.
Introduction to J2EE Architecture
J2EE Application Development
Distributed System Using Java 2 Enterprise Edition (J2EE)
Understanding and Designing with EJB
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
JavaServer Faces: The Fundamentals
Introduction to Web Services
Enterprise Java Beans.
Intro to J2EE Concepts.
Presentation transcript:

J2EE Chris Hundersmarck Maria Baron Jeff Webb

 Java 2 Platform, Micro Edition (J2ME)  Java 2 Platform, Standard Edition (J2SE)  Java 2 Platform, Enterprise Edition (J2EE)  (J2ME) ‘is a subset of’ (J2SE) and (J2EE) ‘is a superset of’ (J2SE).

J2EE is…  A distributed multi-tiered application model for enterprise applications.  Divided into components according to function.  Components installed on different machines Client, Server, Database Server Machines

Containers  Provide access to the underlying services of the J2EE Server environment.  Different types of containers for different types of components  The interface between a component and the low-level functionality that supports a component.

Containers  For example EJB container:  manages the execution of enterprise beans. Web container  manages the execution of JSP pages and servlet components.

Containers

Client Tier 1. Web clients 1. HTML, XML, etc.. 2. Applets 2. Application clients 1. GUI 2. Command line

Web Tier 1. Servlets 2. JSP Pages

Web Components

JavaServer Faces  Lets you create user interfaces from a set of standard, reusable server- side components  Provides a set of JSP tags to access those components  Transparently saves state information and repopulates forms when they redisplay

JavaServer Faces  Provides a framework for implementing custom components  Encapsulates event handling and component rendering so you can use standard JSF components or custom components to support markup languages other than HTML  Lets tool vendors develop IDEs for a standard Web application framework

JSF Components  Each component represents one or more Web page elements  Simple components – individual components such as a text box  Compound components – comprised of multiple elements such as a table

Each JSF component has:  A list of child components  A hashmap of attributes  One or more validators  One or more event handlers  An identifier for an optional renderer

Components  All JSF components perform three fundamental tasks Render the component, typically by generating markup Handle the component's events Validate the component's values

Benefits  Foster the creation of development tools that allow user interface designers to drag and drop components into a layout.  Developer(s) can write event-handling code that will allow the view components to interact with the application model.  Faster GUI creation for prototyping and rapid application development (RAD).

JSP And Java

JSF AND JSP  JSF is not bound to JSP - strict decoupling of components from their view rendering  Rendering is done by using a rendering kit  JSP is a required rendering kit but developers can also use custom rendering kits to render views

Business Tier 1. Enterprise Java Beans 1. Session Beans 2. Entity Beans 3. Message-Driven Bean

Java Beans vs. Enterprise Beans 1. Java Beans are not considered J2EE components by the J2EE specification 2. Java Beans: 1. Can exist on Server tier or Client tier. 2. Manage communication between all three tiers. 3. Enterprise Beans: 1. Only exist on Business Tier as part of the Server Tier

Business Components

Enterprise Java Beans  Server-side component  Encapsulates business logic  Simplifies development EJB container provides system-level services Separates business logic from client. EJB are portable components.

Session Beans 1. Represents a single client. 2. Client invokes the session bean's methods. 3. Performs work for the client. 4. when the client finishes executing, the session bean and its data are gone.

Session Beans  Two types of Session beans: Stateless Stateful

Entity Beans 1. Represents persistent data stored in one row of a database table. 2. If the client terminates or if the server shuts down, the underlying services ensure that the entity bean data is saved.

Entity Beans  What makes Entity Beans different from Session Beans? Persistence Shared Access Primary Key Relationships

Message-Driven Bean 1. Combines features of a session bean and a Java Message Service (JMS) message listener 2. Allows a business component to receive JMS messages asynchronously.

Message-Driven Bean  Message-driven beans have the following characteristics: They execute upon receipt of a single client message. They are invoked asynchronously. They are relatively short-lived. They do not represent directly shared data in the database, but they can access and update this data. They can be transaction-aware. They are stateless.

Component Packaging .jar - Java archive : classes and web content for a J2EE application .war - web application archive .ear – enterprise archive contains the whole application along with deployment descriptor that provides information about the application and its assembled components

Deployment  Deployment tool provides ability to configure and deploy a complex enterprise application onto the : Sun Java System Application Server or onto other application servers

What Is XML ?  Text-based markup language  As with HTML, you identify data using tags. Collectively, the tags are known as markup.  Unlike HTML, XML tags identify the data rather than specify how to display it.

What Is XML ? XML Is Really Cool How many ways is XML cool? Let me count the ways...

Java API for XML Processing  (JAXP) is for processing XML data using applications written in the Java programming language.  Leverages the parser standards: Simple API for XML Parsing (SAX)  parse your data as a stream of events OR Document Object Model (DOM)  build an object representation of it.

Java API for XML Processing  Simple API for XML Parsing (SAX) It is read forward only SAX simply sends data to the application as it is read Requires much less memory than DOM, because SAX does not construct an internal representation (tree structure) of the XML data Fast and efficient

Java API for XML Processing  Document Object Model (DOM) When you need to modify an XML structure interactively in-memory structure (Object model) provides many powerful capabilities for large-scale documents requires more complex coding

JAX-RPC  Java API for XML-based RPC  Technology for building web services and clients that use remote procedure calls (RPC) and XML  Remote procedure call is represented by an XML-based protocol such as SOAP

SOAP  SOAP specification defines the envelope structure encoding rules Conventions for representing remote procedure calls and responses in XML.  These calls and responses are transmitted as SOAP messages (XML files) over HTTP.

SOAP  SOAP messages are complex  The JAX-RPC API hides this complexity from the application developer.

Web Service using JAX-RPC  On the server side, the developer specifies the remote procedures by defining methods in an interface (written in the Java programming language)  The developer also codes one or more classes that implement those methods

Web Service using JAX-RPC  A client creates a proxy (a local object representing the service) and then simply invokes methods on the proxy.  The developer does not generate or parse SOAP messages  The JAX-RPC runtime system converts the API calls and responses to and from SOAP messages.

Web Service using JAX-RPC  JAX-RPC client can access a web service that is not running on the Java platform, and vice versa.  Flexibility is possible because JAX- RPC uses World Wide Web Consortium (W3C) technologies:  HTTP, SOAP, WSDL  WSDL: Web Service Description Language. WSDL specifies an XML format for describing a service.

Web Service using JAX-RPC Web ClientWeb Service

Web Service using JAX-RPC  Service Code Extends the java.rmi.Remote interface Methods must throw the java.rmi.RemoteException or one of its subclasses Method parameters and return types must be supported JAX-RPC types

Hello Web Service package helloservice; import java.rmi.Remote; import java.rmi.RemoteException; public interface HelloIF extends Remote { public String sayHello(String s) throws RemoteException; }

Hello Web Service package helloservice; import java.io.*; public class HelloImpl implements HelloIF { public String message = "Hello "; public String sayHello(String s) { return message + s; }

package staticstub; import javax.xml.rpc.Stub; public class HelloClient { private String endpointAddress; public static void main(String[] args) { System.out.println("Endpoint address = " + args[0]); Stub stub = createProxy(); stub._setProperty(javax.xml.rpc.Stub._ ENDPOINT_ADDRESS_PROPERTY, args[0]); HelloIF hello = (HelloIF) stub; System.out.println(hello.sayHello("Duke!")); } private static Stub createProxy() { return (Stub) (new MyHelloService_Impl().getHelloIFPort()); }

package staticstub; import javax.xml.rpc.Stub; public class HelloClient { private String endpointAddress; public static void main(String[] args) { System.out.println("Endpoint address = " + args[0]); Stub stub = createProxy(); stub._setProperty(javax.xml.rpc.Stub._ ENDPOINT_ADDRESS_PROPERTY, args[0]); HelloIF hello = (HelloIF) stub; System.out.println(hello.sayHello("Duke!")); } private static Stub createProxy() { return (Stub) (new MyHelloService_Impl().getHelloIFPort()); }