Advance Java
Web Application
LEVEL – PRACTITIONER
About the Author
Created By: Shanmu (105110)
Credential Sr Architect
Information:
Version and 1.0, January 02 2011
Date:
2
Icons Used
Hands on
Questions Tools Exercise
Coding Test Your Case Study
Standards Understanding
Best Practices
Demonstration & Industry
Workshop
Standards
3
Objectives
After completing this chapter you will be able to understand:
What is a Web application?
Basics of HTTP.
What is a web server?
What is a Application server?
Types of application packages.
4
What is a Web Application?
Web Application is a collection of components assembled to provide
services over the web for users to consume the service provided.
Example:
•Online Train Ticket reservation.
•Internet Banking.
5
Web Application Building blocks
Web Application are built using the following building blocks,
•Passive Resources – Resources which does not have processing
capabilities. The requested resource is delivered as it is.
Example: HTML, Image files.
•Active Resources - Resources which has processing capabilities. The
resource can execute some business logic, query database, manage
transactions and provide dynamic data based on user inputs.
Example: Servlets, Enterprise Java beans.
6
How are Web Application accessed?
Web Applications are accessed over the web using URL.
URL Stands for Uniform Resource Locator. – This is a unique identifier
available to locate a particular service.
URL Example:
http:// www.cognizant.com/ payroll/payroll.jsp
http is the protocol This is the unique resource
using which the client name (URN). Represents the
access the resource. resource name with the path.
7
How Http Works?
Http stands for Hypertext Transfer Protocol.
1. Clients opens Connection
2. Clients sends HTTP Request
3. Server sends HTTP Response
4. Client closes Connection
Client
Browser
Web server
Since the connection is open and closed for each HTTP request, the state is not
maintained across HTTP requests. Hence this is called “Stateless Protocol”
8
Where do web application live?
Web application are deployed and managed in web (or) application server.
The web/app server acts as a gateway between the client request and the web
application. It also serves as a container to manage the life cycle of the web
application.
Difference between application and Web server?
Web server is a software which provides services to host web applications which can
be accessed via HTTP protocol. Example: Application built using servlet/JSP only.
Application server (or) Java EE server is a software which supports application
built over HTTP and other protocols such as IIOP, RMI, JMS. It also provides services
to manage application built using JDBC transaction, JNDI tree, EJB , LDAP,JMS etc.
9
Web application Multiple Tiers.
The client machine which
access the application using
a http client. Example:
Web browser.
Web Tier: Typically are the
HTML/JSP/JSF pages.
Business Tier: Typically are
EJB, JMS or other business
objects where the business
processing logic resides.
These are servers to store
information needed by the
application
10
How are web application deployed?
In order to deploy a web application in web/application server it needs to be packaged and
deployed in a specific format which can be recognized by the servers.
The packaging formats are as follows,
Packaging Format
Jar War EAR
Java Archive format Web Archive format Enterprise Archive
used for packaging used for packaging web format used for
standalone application application containing packaging jar files
or application modules servlets, JSP, HTML, containing business
containing one or image files or other components (EJB) and
more classes. web components. War files containing web
components.
11
Few real world points
•In project the commonly used package format is EAR format.
•The web components of the application will be packaged as WAR, the EJB (or)
business components packaged as JAR. The JAR and the WAR will be packaged in
a EAR.
EAR File contains WAR + JAR file.
•Project use application server for deploying the EAR files.
•The packaging will be done using ANT/Maven scripts which maintained by the
release engineering team.
12
Advance Java
You have successfully completed -
Web application basics.