1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.

Slides:



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

1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
J2EE Overview.
JSP and web applications
An architecture for webb applications, J2EE
6/2/2015Page 1 SOA Development and Deployment B. Ramamurthy.
DT228/3 Web Development Introduction to Java Server Pages (JSP)
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
Java 2 – Enterprise Edition Kevin J. LaFata April 21, 2003 UM – St. Louis.
J2EE Java2 Enterprise Edition by Damian Borth. Contents Introduction Architectures styles Components Scenarios Roles Processing a HTTP request.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Tomcat Configuration A Very, Very, Very Brief Overview.
CS6320 – J2EE L. Grewe MOTIVATION: E-commerce and Enterprise Computing Models Four models for e-commerce and enterprise computing: Four models for e-commerce.
© 2004 IBM Corporation BEA WebLogic Server Introduction and Training.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
Java Servlets and JSP.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
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.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
IMS Technical Conference IMS Java Remote Database Services Kyle Charlet.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
Notes of J2EE Tutorial Matt Tsai. 2 Outline Chapter 1: Overview Chapter 1: Overview Chapter 2: Understanding XML Chapter 2: Understanding XML Chapter.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Java Servlets CS-422. Application Mapping Your servlet application will be mapped to a directory structure: –“myapp” maps to some directory C:/docs/apps/myapp.
Entity Java Beans Jorg Janke Open Source ERP & CRM.
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
Introduction to J2EE Architecture Portions by Kunal Mehta.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Web Applications - Basics. Introduction to Web Web features Clent/Server HyperText Transfer Protocol HyperText Markup Language URL addresses Web server.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Java Servlets & Java Server Pages Lecture July 2013.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
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.
Java Enterprise Edition Programming Page 1 of 9Configuring Servlets Web Application Context Name  In multiple web applications, a “context name” is used.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
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.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
17 Copyright © 2004, Oracle. All rights reserved. Integrating J2EE Components.
Topics to be covered (ni) Client side validation JSF (free tools as well) Webservices Tell Resources e.g. sites Packaging and deploying web applications.
BlueDragon Editions and Advantages Lori Pacheco New Atlanta.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Java High level programming language ◦ Sun Microsystems ◦ ORACLE acquired Java Development Kit – JDK Java Runtime Environment – JRE Java Virtual Machine.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Deploying Web Applications to Tomcat Server Chun Guo
Java Servlets By: Tejashri Udavant..
Introduction to J2EE Architecture
Knowledge Byte In this section, you will learn about:
J2EE Application Development
Web-Services-based Systems Architecture, Design and Implementation
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Objectives In this lesson you will learn about: Need for servlets
Presentation transcript:

1 Build a Web Application on J2EE

2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server – EIS Resources Client – Application Server – EIS Resources Client – Web Server – Application Server – EIS Resources Client – Web Server – Application Server – EIS Resources

3 Client – Web Server – EIS Resources

4 Business to Business

5 Web Application A web application is a collection of servlets, html pages, classes, and other resources that can be bundled and run on multiple containers from multiple vendors. A web application is a collection of servlets, html pages, classes, and other resources that can be bundled and run on multiple containers from multiple vendors. A Web application is located on a central server and provides service to a variety of clients. A Web application is located on a central server and provides service to a variety of clients. Web applications provide dynamic and interactive content to browser-based clients. Web applications provide dynamic and interactive content to browser-based clients.

6 Web Application Environment

7 JDK All J2EE applications require the Java Developers Kit to run Java classes or the Java Virtual Machine (JVM). All J2EE applications require the Java Developers Kit to run Java classes or the Java Virtual Machine (JVM). Download JDK from java.sun.com for free Download JDK from java.sun.com for free Configure several environment variables. Configure several environment variables. JAVA_HOME JAVA_HOME CLASSPATH CLASSPATH

8 Web Application Structure

9 Container The container is an independent application that creates an environment for web components. The container is an independent application that creates an environment for web components.

10 Functions of Container Life cycle management for components. Life cycle management for components. Environment configuration. Environment configuration. Resources. Resources.

11 Web Container An entity that implements the Web component contract of the J2EE architecture. An entity that implements the Web component contract of the J2EE architecture. specify a runtime environment for Web components that includes security, concurrency, life cycle management, transaction, deployment, and other services specify a runtime environment for Web components that includes security, concurrency, life cycle management, transaction, deployment, and other services provide the same services as a JSP container and a federated view of the J2EE platform APIs. provide the same services as a JSP container and a federated view of the J2EE platform APIs. can run a Web application that is tagged as distributable and that executes across multiple Java virtual machines running on the same host or on different hosts. can run a Web application that is tagged as distributable and that executes across multiple Java virtual machines running on the same host or on different hosts.

12 Web Container Provider Open Source Open Source Tomcat Tomcat …… …… Business Product Business Product WebLogic WebLogic WebShpere WebShpere …… ……

13 Tomcat Just a JSP, Servlets Container Just a JSP, Servlets Container jakarta.apache.org/tomcat/index.html jakarta.apache.org/tomcat/index.html

14 Application Container An entity that implements the Java Classes contract of the J2EE architecture. An entity that implements the Java Classes contract of the J2EE architecture. Java Classes include: Java Classes include: EJB EJB other Java Classes other Java Classes access to the J2EE service and communication APIs. access to the J2EE service and communication APIs.

15 Application Container Provider Open Source Open Source JBOSS JBOSS …… …… Business Product Business Product WebLogic WebLogic WebShpere WebShpere Silverstream Silverstream …… ……

16 Connectors The connector is where the abstract really meets the concrete. The connector is where the abstract really meets the concrete. A connector is a translator between an enterprise information system and the J2EE interfaces. A connector is a translator between an enterprise information system and the J2EE interfaces. Another type of connector, a JNDI Service Provider Interface, provides access to naming and directory services. Another type of connector, a JNDI Service Provider Interface, provides access to naming and directory services.

17 JDBC a JDBC driver, provides access to databases. a JDBC driver, provides access to databases.

18 JNDI provides access to naming and directory services provides access to naming and directory services provides a link between Java code and various naming and directory services such as Domain Name System (DNS), Novell Directory Service (NDS), CORBA, and Network Information System (NIS). provides a link between Java code and various naming and directory services such as Domain Name System (DNS), Novell Directory Service (NDS), CORBA, and Network Information System (NIS). allows you to access code and resources across widely separated platforms and directory structures through the use of a simple naming scheme. allows you to access code and resources across widely separated platforms and directory structures through the use of a simple naming scheme.

19 Tools Ant Ant IDE IDE Jbuilder Jbuilder NetBeans NetBeans

20 Data format used in Web Application HTML HTML JSP JSP Image files Image files Gif Gif JPEG JPEG Class file Class file Source code Source code Complied code Complied code XML XML JAR file: used in J2EE for packaging EJBs and client-side Java Applications JAR file: used in J2EE for packaging EJBs and client-side Java Applications WAR file: web applications made from Servlets, JSPs, and supporting classes WAR file: web applications made from Servlets, JSPs, and supporting classes EAR file: contain all of the components that make up a particular J2EE application EAR file: contain all of the components that make up a particular J2EE application

21 Web Application can be exist in WAR files WAR files directory directory

22 Web Application Archive File Web applications can be packaged and signed, using the standard Java Archive tools, into a Web ARchive format (war) file. Web applications can be packaged and signed, using the standard Java Archive tools, into a Web ARchive format (war) file. When packaged into such a form, a META-INF directory will be present which contains information useful to the Java Archive tools. When packaged into such a form, a META-INF directory will be present which contains information useful to the Java Archive tools.

23 Basic Web Application Directory

24 Root The root of this hierarchy serves as a document root for serving files that are part of this context. The root of this hierarchy serves as a document root for serving files that are part of this context. For example, For example, a web application located at /catalog in a web server a web application located at /catalog in a web server the index.html file located at the base of the web application hierarchy can be served to satisfy a request to /catalog/index.html. the index.html file located at the base of the web application hierarchy can be served to satisfy a request to /catalog/index.html.

25 WEB-INF contains all things related to the application that aren’t in the document root of the application contains all things related to the application that aren’t in the document root of the application WEB-INF node is not part of the public document tree of the application. No file contained in the WEB-INF directory may be served directly to a client. WEB-INF node is not part of the public document tree of the application. No file contained in the WEB-INF directory may be served directly to a client.

26 Contents of the WEB-INF directory /WEB-INF/web.xml deployment descriptor /WEB-INF/web.xml deployment descriptor /WEB-INF/classes/* directory for servlet and utility classes. /WEB-INF/classes/* directory for servlet and utility classes. /WEB-INF/lib/*.jar area for Java Archive files which contain servlets, beans, and other utility classes useful to the web application. /WEB-INF/lib/*.jar area for Java Archive files which contain servlets, beans, and other utility classes useful to the web application.

27 Customize Web Application directory

28 Web.xml The web.xml file format is defined in the Servlet Specification, so this file format will be used in every servlet-conforming Java servlet container. The web.xml file format is defined in the Servlet Specification, so this file format will be used in every servlet-conforming Java servlet container. This file format is used in two places in Tomcat: $CATALINA_BASE/conf directory This file format is used in two places in Tomcat: $CATALINA_BASE/conf directory each web application. each web application.

29 Deployment description of Web Application Web.xml Web.xml The deployment elements that contain this information are: The deployment elements that contain this information are: env-entry env-entry ejb-ref ejb-ref resource-ref resource-ref

30 Example of Web.xml Oracle Test App Oracle Test App StudentPackage.contextlisenter StudentPackage.contextlisenter Oracle Datasource example Oracle Datasource example jdbc/myoracle jdbc/myoracle javax.sql.DataSource javax.sql.DataSource Container Container

31 Configure resources used by Web Application use Server.xml to configure resources use Server.xml to configure resources Web container runs in an object-oriented way Web container runs in an object-oriented way dynamically builds its object structure at runtime, based on the configuration files dynamically builds its object structure at runtime, based on the configuration files each major element in the server.xml file creates a software "object," and the ordering and nesting of these elements sets up processing pipelines that allow you to perform filtering, grouping. each major element in the server.xml file creates a software "object," and the ordering and nesting of these elements sets up processing pipelines that allow you to perform filtering, grouping.

32 Context in server.xml A Context represents one web application within a Tomcat instance. A Context represents one web application within a Tomcat instance. the web site is made up of one or more Contexts. the web site is made up of one or more Contexts.

33 key attributes in a Context AttributeMeaning crossContext Specifies whether ServletContext.getContext(otherWebApp) should succeed (true) or return null (false) debug Debugging level docBase URL relative to virtual host path Absolute path to the directory privileged Specifies whether this context can run Container servlets, such as the Manager application reloadable Specifies whether servlet files on disk will be monitored, and reloaded if their timestamp changes

34 Example of Server.xml