My Learnings in Java Course
My Learnings in Java Course
• Java SE is the core Java programming platform. It contains all Java libraries.
Java SE
• The latest version is Java SE 8u131
• It helps to develop and deploy Java applications on desktops, servers, and embedded
environments. It is used to build standalone applications.
Java Editions
FEATURES OF JAVA EE (ENTERPRISE EDITION)
Java ME
Java EE vs. Java SE
The Java EE (Enterprise Edition) differs from Java SE (Java Standard Edition Platform) in terms of the
libraries it provides to deploy:
• fault-tolerant,
• distributed, and
• multi-tier Java software, based largely on modular components running on an application server.
Java EE Libraries and APIs
o database access [JDBC (Java Database Connectivity), JPA (Java Persistence API)]
o remote method invocation (RMI)
o messaging [JMS (Java Message Service)]
o web services
o XML (eXtensible Markup Language) processing
• It also defines standard APIs for Enterprise JavaBeans, Servlets, Portlets, and Java Server Pages (JSP)
The installation guide containing the steps to download and configure Java JDK (standard
edition) and Apache Tomcat (to access additional libraries) can be downloaded from your LMS.
Java EE Architecture
Web Container
Web
Browser
Controller EJB Server
<%
EJB Container
%>
Model
View
Database
Intranet Client
GUI
Application
Java EE Architecture: Features
• Java EE platform facilitates an architecture in which the business components are placed in a separate
tier.
• The Java EE architecture enhances features such as scalability, extensibility, and maintainability.
• Its modular design allows easy modification of the business logic. It provides more security because it
partitions business services from the web tier. It also permits clean job separation of job roles.
• The enterprise components can leverage their EJB container for service, such as component and
resource management, security, persistence, and transactions.
Relating Java EE Architecture Complexity and Robustness
Complexity
Relating Java EE Architecture Complexity and Robustness
KEY POINTS
Complexity
Advanced Java
Topic 2—Distributed Applications and Client-Server Model
• Distributed Applications
• Client Server Model
• HTTP Protocol
• Types of Server Response
• Client Request Types
• HTML
• Running HTML code with Apache
Recall!
• In distributed applications, same application can run across different machines at the same time using internet.
• One machine acts as Server where application is deployed and the other machines act as Client.
Server 1 Server 3
Application Application
Server 2 Server 4
Application Application
The client–server model is a distributed application structure that partitions tasks or workloads between
the providers of a resource or service (web servers) and service requesters (web clients).
A web client is not a user, but a program. Someone who uses this program to send request
to web server is known as “end user.”
Client-Server Model
ARCHITECTURE
Makes request in the form of an URL: Accepts requests from the client and gives back a
http://localhost:8080/applicationname response which can be either static or dynamic.
Responses are delivered in HTML format.
PORT
Network
HTTP Protocol
HTTP (Hypertext Transfer Protocol) is a TCP/IP based communication protocol, which is used to deliver
data over the web.
It provides a standardized way for the client to communicate with the server.
Client-Server Model
SIGNIFICANCE OF URL AND PORT
Uniform Resource Locator (URL) uniquely identifies a resource on the internet and follows HTTP protocol.
http://localhost:8080/MyApplication
• HTTP (Hypertext Transfer Protocol) is a TCP/IP based communication protocol, which is used to deliver
data over the web.
• Hypertext is a structure text that uses logical links between containing text.
• It is a stateless protocol—it does not require the HTTP server to retain information about each user.
Client-Server Model
SERVER RESPONSE
1. Status which tells whether client’s response has successfully reached the server or not. Example: 404
error for page not found.
2. Information about the type of content that the server is going to send. The server sends HTML pages
as response.
3. Actual content, example: when client types http://www.google.com in any browser, the server
navigates the client to the Google home page.
Client-Server Model
SERVER RESPONSE TYPES
• Static Page: There is no change in the content. Client requests a web page and server gets the page
back as response.
• Dynamic Page: The page content changes frequently. Server may not be able to process the request.
Dynamic Content
User Login Home
Map Page
Page Page
Static Content
Web Server
styles.css Dojo.js logo.jpg
Client-Server Model
TYPES OF SERVERS
• Web Server
• Application Server
• Proxy Server
• Virtual ServerBlade Server
• File Server
• Policy Server
It looks for incoming requests and services those requests. It provides middleware services for security and state
Once the web server receives a request, depending on the maintenance, along with data access and persistence.
type of request, it might look for a web page, or execute a
program on the server.
Web servers have plugins to support scripting languages like Application Server can do whatever Web Server is capable of
Perl, PHP, ASP, JSP etc. through which they can generate doing as it has Web Server as an integral part. Additionally, it
dynamic HTTP content. has components and features to support Application level
services such as Connection Pooling, Object Pooling,
Transaction Support, Messaging services, etc.
It acts as a container which serves static content. It acts as container upon which business logic is built.
Web Server only supports Servlets and JSP. Application Server supports distributed transaction and EJB.
Client-Server Model
CLIENT REQUEST TYPES
• GET
• POST
• PUT
• DELETE
• TRACE
• OPTIONS
• HEAD
Client-Server Model
CLIENT REQUEST TYPES: GET
TRACE
OPTION
HEAD
Client-Server Model
CLIENT REQUEST TYPES: POST
DELETE
TRACE
OPTION
HEAD
Client-Server Model
CLIENT REQUEST TYPES: PUT
GET • If the Uniform Resource Identifier (URI) refers to an already existing resource, it is modified. If the
URI does not point to an existing resource, then the server can create the resource with that URI
using PUT.
POST
PUT • It replaces all current representation of the target resource with the uploaded content.
DELETE
TRACE
OPTION
HEAD
Client-Server Model
CLIENT REQUEST TYPES: DELETE
GET • DELETE request is used to delete a document of the target resource given by URL.
• To allow eventual consistency while replication, deleted documents remain in the database forever.
POST
PUT
DELETE
TRACE
OPTION
HEAD
Client-Server Model
CLIENT REQUEST TYPES: TRACE
GET • TRACE request is used when the client wants to see if any change has been done by intermediate server.
PUT
DELETE
TRACE
OPTION
HEAD
Client-Server Model
CLIENT REQUEST TYPES: OPTION
GET • OPTION request returns the HTTP method which is supported by the server.
POST • It allows the client to determine the option requirements associated with a resource.
PUT
DELETE
TRACE
OPTION
HEAD
Client-Server Model
CLIENT REQUEST TYPES: HEAD
GET • HEAD request is used for testing hypertext links for accessibility, validity, and recent modification.
POST • This is similar to GET method, but it asks for response without response body.
PUT
DELETE
TRACE
OPTION
HEAD
Client-Server Model
SERVER RESPONSE: HTML
• It refers to the way the web pages (HTML documents) are linked together. The link available on a
web page is called Hypertext.
• HTML contains tags and elements which are used to format web pages.
Client-Server Model
SERVER RESPONSE: HTML DOCUMENT STRUCTURE
<!DOCTYPE html>
<html>
<head>
<title>Html Program </title>
</head>
<body>
<h1>This is a Heading</h1>
<p>welcome To HTML Program.</p>
</body>
</html>
Client-Server Model
SERVER RESPONSE: RUNNING AN HTML CODE
1 3 3 5
Open any editor Save it with HTML extension in any drive of your system
Running an HTML Code with Apache
TOMCAT APACHE DIRECTORY HIERARCHY
apache-tomcat-8.5.16-windows-x64
bin
lib
webapps
Index.html or
my_project_name
anyname.html
Running an HTML Code with Apache
3. Place your HTML page inside project folder with index.html name or any_other_name.html
6. If html filename is index.html, the above link will open an HTML page. If not, use the following:
http://localhost:8080//my_project_name/any_other_name.html
Screenshot of Project in Apache Webapp
Key Takeaways
Java has three editions: J2SE (standard), J2EE (Enterprise), and J2ME (Micro)
The J2EE (Enterprise Edition) differs from J2SE (Java Standard Edition Platform) in
terms of the libraries it provides to deploy fault-tolerant, distributed and, multi-tier
Java software