SlideShare a Scribd company logo
In this session, you will learn to:
Describe web applications
Describe Java Platform, Enterprise Edition 6 (Java EE 6)
Describe web application program execution methods and the
advantages and disadvantages of each
Describe Java servlet technology
Describe JavaServer Pages technology
Define three-tier architecture
Define Model-View-Controller (MVC) architecture
Objectives
HTML over HTTP
Common Gateway Interface (CGI)
Servlets
JavaServer Pages (JSP) technology
JSP Standard Tag Library (JSTL)
XML
Struts
JavaServer Faces
Web Application Technologies
Java™ EE 6
Java EE is the industry standard for developing portable,
robust, scalable and secure server-side Java applications.
Java EE is built on the solid foundation of Java Platform,
Standard Edition (Java SE).
Java EE is a set of coordinated technologies which includes
the following web application technologies:
Java Servlet 2.6 (Java Specification Requests [JSR] 164)
JavaServer Pages 2.1 (JSR 246)
JavaServer Pages Standard Tag Library (JSR 62)
JavaServer Faces 1.2 (JSR 262)
Java™ EE 6 (Contd.)
For a complete list of Java technologies, go to:
http://java.sun.com/javaee/technologies/
http://java.sun.com/javase/technologies/
Java EE 6 SDK
Web Sites and Web Applications
A web site is a collection of static files, HTML pages,
graphics, and various other files.
A web application is a web site with dynamic functionality on
the server.
A web application run programs on the server, for example:
A browser makes a request, to the server, for an HTML form.
The server responds by sending the HTML form back to the
browser in an HTTP request stream.
Next, the browser sends another request, with data from the
HTML form, to the server.
The server passes the request and data to a program that
responds by sending data back to the browser.
Execution of CGI Programs
A CGI program handling a single request:
Execution of CGI Programs (Contd.)
A CGI program handling multiple requests:
Execution of Java Servlets
A servlet program handling a single request:
Execution of Java Servlets (Contd.)
A servlet program handling multiple requests:
Advantages of running programs in separate processes
over threads:
Programs can be written in a variety of languages
Web designers can easily reference programs that run in
separate processes.
Advantages of running servlet programs in threads
compared with other languages not in threads:
The CPU requirements are lower.
Java technologies separate processing code (business logic)
from the HTML (presentation logic).
The Java language is robust and object-oriented.
The Java language is platform-independent.
Using Separate Processes or Using Threads
Java Servlets
A servlet is a Java technology component that executes on
the server.
Servlet programs perform the following:
Process HTTP requests
Generate dynamic HTTP responses
A web container is a special Java Virtual Machine (JVM™)
tool interface that manages the servlets and a thread pool.
JavaServer Pages™ Technology
JSP pages are translated into Java servlet classes that are
compiled and execute as servlets in the web container.
JSP pages should focus on the presentation logic, not on
the business logic. This makes for a good design.
In JSP pages, custom tags and JSP Expression Language
provide for reusable code and separation of concerns.
Java code can be embedded into JSP pages.
In a Java technology web application, JSP pages are often
used in conjunction with servlets and business objects in a
Model-View-Controller pattern.
Demo: JavaServer Pages™ Technology
Demo: JavaServerPages Technology
Concerns When Using Servlets and JSP™ Technology
Advantages of JSP technology:
Provides high performance and scalability because threads are
used
Is built on Java technology, so it is platform-independent.
Can take advantage of the object-oriented language and its
APIs
Concerns When Using Servlets and JSP™ Technology (Contd.)
Disadvantages of JSP technology:
If JSP pages are used in isolation, then the scripting code that
performs business and control logic can become cumbersome
in the JSP pages. JSP pages are also difficult to debug.
There is separation of concerns into business logic and
presentation logic.
There are concurrency issues.
Web Application – Three-Tier Architecture
Model-View-Controller (MVC) Architecture in a Web
Application
Model 2 Architecture
Deployment diagram of a web container using Model 2
architecture:
Frameworks are partial implementations on which you can
build your components.
There are several Model 2 frameworks available:
Struts from the Jakarta group
JavaServer Faces technology from Sun
Velocity from Apache
Model 2 Frameworks
Modular design allows for easier modification of the
business logic.
Enterprise components can use container-provided services
such as presentation, security, transaction, persistence, and
life cycle management.
Java EE Containers
Java EE Architecture Example
Job Roles
The modularity of Java EE architecture clearly distinguishes
several job roles:
Web Designer – Creates View elements
Web Component Developer – Creates Controller elements
Business Component Developer – Creates Model elements
Data Access Developer – Creates database access elements
A matrix showing the relationship between an architecture’s
complexity and robustness, based on the technologies
used:
Web Application Migration
In this session, you learned:
CGI provided hooks for web servers to execute application
programs.
Java servlets are similar to CGI, but they execute in a JVM
using threading.
JSP pages are similar to servlets, but they are better suited for
generating HTML content.
The Model 2 architecture uses servlets in conjunction with JSP
pages to build web applications.
Well designed web applications using Model 2 can be easily
migrated to more complex Java EE architectures.
Summary

More Related Content

What's hot (19)

PDF
Pilot Study - WSO2 Enterprise Integrator v6.1.1
GaneshNagalingam1
 
PDF
Integrating WebSphere Service Registry and Repository V8 with Process Server
GaneshNagalingam1
 
PPTX
Chapter2 j2ee
Jafar Nesargi
 
PPT
Flex for enterprise applications
darshanvartak
 
DOCX
Actively looking for an opportunity to work as a challenging Dot Net Developer
Karthik Reddy
 
ODP
Putting *Sparkle* in Your Social Applications! Customization and Branding wit...
Mitch Cohen
 
PDF
Websphere Portal
dominion
 
PDF
IBM WebSphere Portal References Education
Dvir Reznik
 
DOCX
J2 ee tutorial ejb
Niraj Bharambe
 
DOCX
Java unit 4_cs_notes
Niraj Bharambe
 
PPTX
J2ee web services(overview)
Prafull Jain
 
PDF
01 web sphere portal business overview
ygolani
 
PDF
Bn1001 demo ppt advance dot net
conline training
 
PPT
WebSphere Portal Business Overview
Joel Demay
 
DOCX
SeniorNET Bhanu Resume
(Actively Looking) Akunuru
 
PPT
Introduction to WebSphere Message Broker
Ant Phillips
 
PPT
Greate Introduction to Oracle Fusion Middleware and ADF
Mohamed Shahpoup
 
PPTX
Java ee introduction
Moumie Soulemane
 
DOCX
Online advertising management system
Yesu Raj
 
Pilot Study - WSO2 Enterprise Integrator v6.1.1
GaneshNagalingam1
 
Integrating WebSphere Service Registry and Repository V8 with Process Server
GaneshNagalingam1
 
Chapter2 j2ee
Jafar Nesargi
 
Flex for enterprise applications
darshanvartak
 
Actively looking for an opportunity to work as a challenging Dot Net Developer
Karthik Reddy
 
Putting *Sparkle* in Your Social Applications! Customization and Branding wit...
Mitch Cohen
 
Websphere Portal
dominion
 
IBM WebSphere Portal References Education
Dvir Reznik
 
J2 ee tutorial ejb
Niraj Bharambe
 
Java unit 4_cs_notes
Niraj Bharambe
 
J2ee web services(overview)
Prafull Jain
 
01 web sphere portal business overview
ygolani
 
Bn1001 demo ppt advance dot net
conline training
 
WebSphere Portal Business Overview
Joel Demay
 
SeniorNET Bhanu Resume
(Actively Looking) Akunuru
 
Introduction to WebSphere Message Broker
Ant Phillips
 
Greate Introduction to Oracle Fusion Middleware and ADF
Mohamed Shahpoup
 
Java ee introduction
Moumie Soulemane
 
Online advertising management system
Yesu Raj
 

Similar to Web Component Development with Servlet and JSP Technologies Unit 01 (20)

PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PPSX
Intorduction to struts
Anup72
 
PPT
Ppt for Online music store
ADEEBANADEEM
 
PDF
Enterprise Java, Servlet, JDBC and JSP.pdf
PokemonSpyk
 
PDF
Java part 3
ACCESS Health Digital
 
PDF
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
PPTX
Summer training seminar
Govind Singh Mahecha
 
PPT
Lecture 19 dynamic web - java - part 1
Д. Ганаа
 
PPT
Programming Server side with Sevlet
backdoor
 
PPT
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
KalsoomTahir2
 
PPTX
Introduction to ejb and struts framework
s4al_com
 
PDF
Core Servlets and JavaServer Pages Vol 1 Core Technologies 2. ed., Nachdr Edi...
wariamaibao
 
PPTX
J2ee seminar
Sahil Kukreja
 
PPTX
AJ.pptx
ShuvraKantiMandal
 
PPTX
Arpita industrial trainingppt
ARPITA SRIVASTAVA
 
PDF
Difference between jsf, servlet and jsp
Mindfire LLC
 
PPTX
Jsp and Servlets
Raghu nath
 
PPT
Enterprise application developement
Archana Jha
 
PPTX
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
PDF
Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applicat...
SSA KPI
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Intorduction to struts
Anup72
 
Ppt for Online music store
ADEEBANADEEM
 
Enterprise Java, Servlet, JDBC and JSP.pdf
PokemonSpyk
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Summer training seminar
Govind Singh Mahecha
 
Lecture 19 dynamic web - java - part 1
Д. Ганаа
 
Programming Server side with Sevlet
backdoor
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
KalsoomTahir2
 
Introduction to ejb and struts framework
s4al_com
 
Core Servlets and JavaServer Pages Vol 1 Core Technologies 2. ed., Nachdr Edi...
wariamaibao
 
J2ee seminar
Sahil Kukreja
 
Arpita industrial trainingppt
ARPITA SRIVASTAVA
 
Difference between jsf, servlet and jsp
Mindfire LLC
 
Jsp and Servlets
Raghu nath
 
Enterprise application developement
Archana Jha
 
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applicat...
SSA KPI
 
Ad

More from Prashanth Shivakumar (11)

PPS
XML Unit 01
Prashanth Shivakumar
 
PPS
WPF (Windows Presentation Foundation Unit 01)
Prashanth Shivakumar
 
PPS
WCF (Windows Communication Foundation_Unit_01)
Prashanth Shivakumar
 
PPT
VB.Net GUI Unit_01
Prashanth Shivakumar
 
PPS
UML Unit 01
Prashanth Shivakumar
 
PPT
RDBMS_Unit 01
Prashanth Shivakumar
 
PPS
J2ME Unit_01
Prashanth Shivakumar
 
PPS
Data Structures and Algorithms Unit 01
Prashanth Shivakumar
 
PPS
C++ Unit_01
Prashanth Shivakumar
 
PPS
Advanced excel unit 01
Prashanth Shivakumar
 
PPS
C programming unit 01
Prashanth Shivakumar
 
WPF (Windows Presentation Foundation Unit 01)
Prashanth Shivakumar
 
WCF (Windows Communication Foundation_Unit_01)
Prashanth Shivakumar
 
VB.Net GUI Unit_01
Prashanth Shivakumar
 
RDBMS_Unit 01
Prashanth Shivakumar
 
J2ME Unit_01
Prashanth Shivakumar
 
Data Structures and Algorithms Unit 01
Prashanth Shivakumar
 
Advanced excel unit 01
Prashanth Shivakumar
 
C programming unit 01
Prashanth Shivakumar
 
Ad

Recently uploaded (20)

PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 

Web Component Development with Servlet and JSP Technologies Unit 01

  • 1. In this session, you will learn to: Describe web applications Describe Java Platform, Enterprise Edition 6 (Java EE 6) Describe web application program execution methods and the advantages and disadvantages of each Describe Java servlet technology Describe JavaServer Pages technology Define three-tier architecture Define Model-View-Controller (MVC) architecture Objectives
  • 2. HTML over HTTP Common Gateway Interface (CGI) Servlets JavaServer Pages (JSP) technology JSP Standard Tag Library (JSTL) XML Struts JavaServer Faces Web Application Technologies
  • 3. Java™ EE 6 Java EE is the industry standard for developing portable, robust, scalable and secure server-side Java applications. Java EE is built on the solid foundation of Java Platform, Standard Edition (Java SE). Java EE is a set of coordinated technologies which includes the following web application technologies: Java Servlet 2.6 (Java Specification Requests [JSR] 164) JavaServer Pages 2.1 (JSR 246) JavaServer Pages Standard Tag Library (JSR 62) JavaServer Faces 1.2 (JSR 262)
  • 4. Java™ EE 6 (Contd.) For a complete list of Java technologies, go to: http://java.sun.com/javaee/technologies/ http://java.sun.com/javase/technologies/
  • 5. Java EE 6 SDK
  • 6. Web Sites and Web Applications A web site is a collection of static files, HTML pages, graphics, and various other files. A web application is a web site with dynamic functionality on the server. A web application run programs on the server, for example: A browser makes a request, to the server, for an HTML form. The server responds by sending the HTML form back to the browser in an HTTP request stream. Next, the browser sends another request, with data from the HTML form, to the server. The server passes the request and data to a program that responds by sending data back to the browser.
  • 7. Execution of CGI Programs A CGI program handling a single request:
  • 8. Execution of CGI Programs (Contd.) A CGI program handling multiple requests:
  • 9. Execution of Java Servlets A servlet program handling a single request:
  • 10. Execution of Java Servlets (Contd.) A servlet program handling multiple requests:
  • 11. Advantages of running programs in separate processes over threads: Programs can be written in a variety of languages Web designers can easily reference programs that run in separate processes. Advantages of running servlet programs in threads compared with other languages not in threads: The CPU requirements are lower. Java technologies separate processing code (business logic) from the HTML (presentation logic). The Java language is robust and object-oriented. The Java language is platform-independent. Using Separate Processes or Using Threads
  • 12. Java Servlets A servlet is a Java technology component that executes on the server. Servlet programs perform the following: Process HTTP requests Generate dynamic HTTP responses A web container is a special Java Virtual Machine (JVM™) tool interface that manages the servlets and a thread pool.
  • 13. JavaServer Pages™ Technology JSP pages are translated into Java servlet classes that are compiled and execute as servlets in the web container. JSP pages should focus on the presentation logic, not on the business logic. This makes for a good design. In JSP pages, custom tags and JSP Expression Language provide for reusable code and separation of concerns. Java code can be embedded into JSP pages. In a Java technology web application, JSP pages are often used in conjunction with servlets and business objects in a Model-View-Controller pattern.
  • 14. Demo: JavaServer Pages™ Technology Demo: JavaServerPages Technology
  • 15. Concerns When Using Servlets and JSP™ Technology Advantages of JSP technology: Provides high performance and scalability because threads are used Is built on Java technology, so it is platform-independent. Can take advantage of the object-oriented language and its APIs
  • 16. Concerns When Using Servlets and JSP™ Technology (Contd.) Disadvantages of JSP technology: If JSP pages are used in isolation, then the scripting code that performs business and control logic can become cumbersome in the JSP pages. JSP pages are also difficult to debug. There is separation of concerns into business logic and presentation logic. There are concurrency issues.
  • 17. Web Application – Three-Tier Architecture
  • 19. Model 2 Architecture Deployment diagram of a web container using Model 2 architecture:
  • 20. Frameworks are partial implementations on which you can build your components. There are several Model 2 frameworks available: Struts from the Jakarta group JavaServer Faces technology from Sun Velocity from Apache Model 2 Frameworks
  • 21. Modular design allows for easier modification of the business logic. Enterprise components can use container-provided services such as presentation, security, transaction, persistence, and life cycle management. Java EE Containers
  • 23. Job Roles The modularity of Java EE architecture clearly distinguishes several job roles: Web Designer – Creates View elements Web Component Developer – Creates Controller elements Business Component Developer – Creates Model elements Data Access Developer – Creates database access elements
  • 24. A matrix showing the relationship between an architecture’s complexity and robustness, based on the technologies used: Web Application Migration
  • 25. In this session, you learned: CGI provided hooks for web servers to execute application programs. Java servlets are similar to CGI, but they execute in a JVM using threading. JSP pages are similar to servlets, but they are better suited for generating HTML content. The Model 2 architecture uses servlets in conjunction with JSP pages to build web applications. Well designed web applications using Model 2 can be easily migrated to more complex Java EE architectures. Summary

Editor's Notes

  • #2: Start the session by explaining the objectives listed in Slide 1.
  • #3: In this slide, tell the students about the Web application technologies. Start by describing the HTTP. Tell that the HTTP is a request/response protocol between clients and servers. Tell the students that the Servlets, JSP, and Struts will be covered in the later part of this module.
  • #4: In this slide, explain to the students about the Java Platform, Enterprise Edition 6 as given in SG.
  • #5: Open the hyperlink given in this slide to show to the students the complete list of Java technologies.
  • #6: Use this slide to explain to the students about the Java EE 6 SDK.
  • #7: Use this slide to explain to the students about the Web sites and Web applications.
  • #8: Use Slides 7 and 8 to explain the execution of the CGI programs. Explain about the CGI programs and their advantages and disadvantages, as given in pages 1-9 to 1-12 of the SG.
  • #10: Use Slides 9 and 10 to explain the execution of the Java Servlets.
  • #12: Use this slide to explain about the advantages and disadvantages of using Servlets over the CGI programs.
  • #13: In this slide, explain to the students about the Java Servlets. Tell the students that the Servlets allow you to add dynamic content to a Web server using the Java platform.
  • #14: Use this slide to explain about the JavaServerPages technology.
  • #15: Use this slide to demonstrate the comparison of JSP and servlet coding to the students. You can run the project, SquaresServlet stored at Datafiles For Faculty\Session01\Demo1\SquaresServlet.zip file in the TIRM CD. This project contains a JSP file, index.jsp, which displays the squares of numbers 0 through 9 in an HTML table. You can show the students the equivalent servlet, SquaresServlet.java, which can be found at Datafiles For Faculty\Session01\Demo1 in the TIRM CD.
  • #16: Use Slides 14 and 16 to explain to the students about the advantages and disadvantages of JSP technology. Also, tell the students about when to use Servlets and JSP technology in the Web application.
  • #18: Use this slide to explain to the students about the three-tier architecture for Web applications.
  • #19: Use this slide to explain about the Model-View-Controller (MVC) architecture in Web application.
  • #20: Use this slide to explain about the Model 2 architecture. In the Model 2 architecture, Servlets control the flow of the web application and delegate the business logic to external components, such as JavaBeans or EJBs, while JSP pages generate the HTML for web browsers.
  • #21: Use this slide to explain about the Model 2 frameworks.
  • #22: Use this slide to explain about the Java EE containers. Explain that the containers are the interface between a component and the low-level platform-specific functionality that supports the component. Before the execution of a web application, it must be assembled into a Java EE module and deployed into its container.
  • #23: In this slide, explain to the students about the Java EE architecture. Also, discuss about its features such as scalability, extensibility, and maintainability.
  • #24: Use this slide to discuss about the Job roles.
  • #25: Use this slide to explain a matrix of the relationship between an architecture’s complexity and robustness, based on technologies used.
  • #26: End the session by discussing the summary points as given in Slide 26.