SlideShare a Scribd company logo
4
Most read
10
Most read
11
Most read
COURSE:WEB TECHNOLOGIES
INTRODUCTION TO JSP,JSP LIFE
CYCLE, ANATOMY OF JSP PAGE
AND JSP PROCESSING
By
AAQIB HUSSAIN
MODULE-III
2
Course outcome / Topic learning outcome
Name of the Topic covered Topic Learning Outcome Course Outcome
Introduction to
JSP,Anatomy of JSP page
and JSP Processing
Understand and apply
the methods of servlet
for request - response
paradigm.
Develop a server side web
application using servlets
for request-response
programming paradigm
List the course outcome / Topic outcome
3
Outcome achieved
Name of the topic: Introduction to JSP,Anatomy of JSP page
and JSP Processing
Students will be able to do:
1 Design the dynamic web pages using HTML and JSP
2
JAVA SERVER PAGES
Introduction to JSP:
• Besides servlets there exists one more java based
technology called JSP(Java Server Pages) to develop
web applications.
• JSP was developed by Sun Micro Systems to allow
server side development.JSP is a kind of scripting
language in which we can embed java code along
with HTML elements.
• JSP is textual document that describes how to create
a response object from a request object of a given
JAVA SERVER PAGES
In the processing of JSP include:
• A JSP page defines JSP page implementation class
that implements the javax.servlet interface.
• At the request time ,the request is made to JSP page
which will be delivered to the JSP page
implementation object for processing.
• In any web application a program on server processes
request and generate response by using default HTTP
protocol.
JSP LIFE CYCLE
In the processing of JSP include:
• The web server needs a JSP engine, i.e, a container to
process JSP pages. It resides inside the webserver.The
JSP container is responsible for intercepting requests
for JSP pages.
Compilation process of JSP page involves three steps:
• Parsing of JSP
• Turning JSP into servlet
• Compiling the servlet
JSP LIFE CYCLE
1.Translation-
demo.jsp page
is translated in
to Servlet
2.Compilation-
Servlet
demo_jsp.java
is created
3.Class Loading-
demo_ jsp.java
is loaded in to
demo_jsp.class
6.Request Processing-
Servlet demo_jsp.java
is executed using
service method
5.Initiaization-
Servlet demo_ljsp
is initialized
4.Instantiation-
Servlet
demo_jsp is
instantiated
7.Destroy-
Servlet
demo_jsp is
destroyed
Anatomy of
JSP
A JSP page is a web page with JSP elements for generating the parts that
differ for each request.
Anatomy of JSP
• JSP page is a combination of JSP element and template text.
• Template text can be any text which includes HTML, WML, XML, or
even plain text. it can be used with any markup language.
• Template text is always passed directly to the browser.
• When a JSP page request is processed, the template text and
dynamic content generated by the JSP elements are merged, and the
result is sent as the response to the browser.
JSP Processing
• A web server needs a servlet container to provide an interface to
servlets, the server needs a JSP container to process JSP pages.
• The JSP container is responsible for intercepting requests for JSP
pages.
• To process all JSP elements in the page, the container first turns the
JSP page into a servlet (known as the JSP page implementationclass).
• The template text is converted to println( ) statements similar to the
ones in the hand-coded servlet and all JSP elements are converted to
Java code that implements the corresponding dynamic behavior. The
container then compiles the servlet class.
• Converting the JSP page to a servlet and compiling the servlet form
the translation phase.
• The JSP container initiates the translation phase for a page
automatically when it receives the first request for the page. Since
the translation phase takes a bit of time, the first user to request a
JSP page notices a slight delay.
• The translation phase can also be initiated explicitly and is referred to
as pre-compilation of a JSP page.
• Pre-compiling a JSP page is a way to avoid hitting the first user with
this delay.
• The JSP container is also responsible for invoking the JSP page
implementation class (the generated servlet) to process each request
and generate the response. This is called the request processing
phase.
The two phases are illustrated in the
figure
Anatomy of JSP
• JSP page is a combination of JSP element and template text.
• Template text can be any text which includes HTML, WML, XML, or
even plain text. it can be used with any markup language.
• Template text is always passed directly to the browser.
• When a JSP page request is processed, the template text and
dynamic content generated by the JSP elements are merged, and the
result is sent as the response to the browser.
• As long as the JSP page remains unchanged, any subsequent request
goes straight to the request processing phase (i.e., the container
simply executes the class file).
• When the JSP page is modified, it goes through the translation phase
again before entering the request processing phase.
• The JSP container is also responsible for invoking the JSP page
implementation class (the generated servlet) to process each request
and generate the response. This is called the request processing
phase.
JSP Declarations
• A JSP declaration declares one or more variables or methods that
one can use in Java code later in the JSP file.
• The JSP declaration tag is a piece of java code mainly used to declare
fields and methods
SYNTAX
<%! declaration; [ declaration; ]+ ... %>

More Related Content

PPTX
PPTX
Java/Servlet/JSP/JDBC
PPT
Java web services
PPTX
Servlets
PPTX
Ajax and Jquery
PPTX
Servlets api overview
PDF
JPA and Hibernate
PDF
Servlet and servlet life cycle
Java/Servlet/JSP/JDBC
Java web services
Servlets
Ajax and Jquery
Servlets api overview
JPA and Hibernate
Servlet and servlet life cycle

What's hot (20)

PPT
Servlet life cycle
PPTX
anatomy of a jsp page & jsp syntax.pptx
PPT
Jsp ppt
PPSX
JDBC: java DataBase connectivity
PPTX
Agents in Artificial intelligence
PPTX
Java Server Pages(jsp)
PPTX
Lec 7 query processing
PPTX
Graph coloring using backtracking
PPS
Jdbc architecture and driver types ppt
PPTX
Code generation
PPTX
Jdbc ppt
PPTX
Java program structure
PPTX
Java servlets and CGI
PPT
PDF
Identifying classes and objects ooad
PPTX
PPTX
Threads (operating System)
PPTX
Concurrency Control in Database Management System
PPTX
Distributed DBMS - Unit 6 - Query Processing
PPT
SQLITE Android
Servlet life cycle
anatomy of a jsp page & jsp syntax.pptx
Jsp ppt
JDBC: java DataBase connectivity
Agents in Artificial intelligence
Java Server Pages(jsp)
Lec 7 query processing
Graph coloring using backtracking
Jdbc architecture and driver types ppt
Code generation
Jdbc ppt
Java program structure
Java servlets and CGI
Identifying classes and objects ooad
Threads (operating System)
Concurrency Control in Database Management System
Distributed DBMS - Unit 6 - Query Processing
SQLITE Android
Ad

Similar to INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING (20)

PPTX
Jsp basic
PPTX
WT Unit-Vuufvmjn dissimilating Dunkirk k
DOCX
Java server pages
PPTX
JavaScript, often abbreviated as JS, is a programming language and core techn...
DOCX
Unit 4 1 web technology uptu
DOCX
Unit 4 web technology uptu
PPTX
C:\fakepath\jsp01
PPTX
JSP.pptx
PPTX
JSP- JAVA SERVER PAGES
PDF
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
PPT
PDF
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
PPTX
Module 3.pptx.............................
PDF
JSP Technology I
PPTX
Introduction - Java Server Programming (JSP)
PPTX
PPTX
JAVA SERVER PAGES
PDF
Java Server Pages
PPTX
Java Server Pages
Jsp basic
WT Unit-Vuufvmjn dissimilating Dunkirk k
Java server pages
JavaScript, often abbreviated as JS, is a programming language and core techn...
Unit 4 1 web technology uptu
Unit 4 web technology uptu
C:\fakepath\jsp01
JSP.pptx
JSP- JAVA SERVER PAGES
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
Module 3.pptx.............................
JSP Technology I
Introduction - Java Server Programming (JSP)
JAVA SERVER PAGES
Java Server Pages
Java Server Pages
Ad

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
A Presentation on Artificial Intelligence
Modernizing your data center with Dell and AMD
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
A Presentation on Artificial Intelligence

INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING

  • 1. COURSE:WEB TECHNOLOGIES INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING By AAQIB HUSSAIN MODULE-III
  • 2. 2 Course outcome / Topic learning outcome Name of the Topic covered Topic Learning Outcome Course Outcome Introduction to JSP,Anatomy of JSP page and JSP Processing Understand and apply the methods of servlet for request - response paradigm. Develop a server side web application using servlets for request-response programming paradigm List the course outcome / Topic outcome
  • 3. 3 Outcome achieved Name of the topic: Introduction to JSP,Anatomy of JSP page and JSP Processing Students will be able to do: 1 Design the dynamic web pages using HTML and JSP 2
  • 4. JAVA SERVER PAGES Introduction to JSP: • Besides servlets there exists one more java based technology called JSP(Java Server Pages) to develop web applications. • JSP was developed by Sun Micro Systems to allow server side development.JSP is a kind of scripting language in which we can embed java code along with HTML elements. • JSP is textual document that describes how to create a response object from a request object of a given
  • 5. JAVA SERVER PAGES In the processing of JSP include: • A JSP page defines JSP page implementation class that implements the javax.servlet interface. • At the request time ,the request is made to JSP page which will be delivered to the JSP page implementation object for processing. • In any web application a program on server processes request and generate response by using default HTTP protocol.
  • 6. JSP LIFE CYCLE In the processing of JSP include: • The web server needs a JSP engine, i.e, a container to process JSP pages. It resides inside the webserver.The JSP container is responsible for intercepting requests for JSP pages. Compilation process of JSP page involves three steps: • Parsing of JSP • Turning JSP into servlet • Compiling the servlet
  • 7. JSP LIFE CYCLE 1.Translation- demo.jsp page is translated in to Servlet 2.Compilation- Servlet demo_jsp.java is created 3.Class Loading- demo_ jsp.java is loaded in to demo_jsp.class 6.Request Processing- Servlet demo_jsp.java is executed using service method 5.Initiaization- Servlet demo_ljsp is initialized 4.Instantiation- Servlet demo_jsp is instantiated 7.Destroy- Servlet demo_jsp is destroyed
  • 8. Anatomy of JSP A JSP page is a web page with JSP elements for generating the parts that differ for each request.
  • 9. Anatomy of JSP • JSP page is a combination of JSP element and template text. • Template text can be any text which includes HTML, WML, XML, or even plain text. it can be used with any markup language. • Template text is always passed directly to the browser. • When a JSP page request is processed, the template text and dynamic content generated by the JSP elements are merged, and the result is sent as the response to the browser.
  • 10. JSP Processing • A web server needs a servlet container to provide an interface to servlets, the server needs a JSP container to process JSP pages. • The JSP container is responsible for intercepting requests for JSP pages. • To process all JSP elements in the page, the container first turns the JSP page into a servlet (known as the JSP page implementationclass). • The template text is converted to println( ) statements similar to the ones in the hand-coded servlet and all JSP elements are converted to Java code that implements the corresponding dynamic behavior. The container then compiles the servlet class. • Converting the JSP page to a servlet and compiling the servlet form the translation phase.
  • 11. • The JSP container initiates the translation phase for a page automatically when it receives the first request for the page. Since the translation phase takes a bit of time, the first user to request a JSP page notices a slight delay. • The translation phase can also be initiated explicitly and is referred to as pre-compilation of a JSP page. • Pre-compiling a JSP page is a way to avoid hitting the first user with this delay. • The JSP container is also responsible for invoking the JSP page implementation class (the generated servlet) to process each request and generate the response. This is called the request processing phase.
  • 12. The two phases are illustrated in the figure
  • 13. Anatomy of JSP • JSP page is a combination of JSP element and template text. • Template text can be any text which includes HTML, WML, XML, or even plain text. it can be used with any markup language. • Template text is always passed directly to the browser. • When a JSP page request is processed, the template text and dynamic content generated by the JSP elements are merged, and the result is sent as the response to the browser.
  • 14. • As long as the JSP page remains unchanged, any subsequent request goes straight to the request processing phase (i.e., the container simply executes the class file). • When the JSP page is modified, it goes through the translation phase again before entering the request processing phase. • The JSP container is also responsible for invoking the JSP page implementation class (the generated servlet) to process each request and generate the response. This is called the request processing phase.
  • 15. JSP Declarations • A JSP declaration declares one or more variables or methods that one can use in Java code later in the JSP file. • The JSP declaration tag is a piece of java code mainly used to declare fields and methods SYNTAX <%! declaration; [ declaration; ]+ ... %>