SlideShare a Scribd company logo
2
Most read
8
Most read
11
Most read
JSP Processing
1
Submitted by -
Sadhana Singh
Shri Ram Murti Smarak College of Engg. & Tech.
2
JSP Pages
 JSP page file ends with “.jsp” by default
 JSP pages are organized like any other HTML files using
the normal directory/file structure
 A JSP page is usually composed of regular HTML tags
and JSP scripting elements
 JSP page is implicitly compiled to servlet class and
loaded into memory
 when the page is requested the first time after creation, or
 when the page is requested the first time after modification
 Refer to table 10.1 in the textbook and the next slide
Model-View-Controller
 A Design Pattern
 Controller -- receives user interface input,
updates data model
 Model -- represents state of the world (e.g.
shopping cart)
 View -- looks at model and generates an
appropriate user interface to present the
data and allow for further input
3
Model viewer-controller-
4
Bean
JSP
Servlet
Controller
View
Model
J2EE Applications
5
6
JSP Compilation and Execution
JSP Page
Compile JSP Servlet Instance in Memory
init()
service()
First request
after creation or
modification
Subsequent
Requests (can
be from
different users
and sessions)
JSP Servlet
Automatic Compilation
7
JSP Elements
 Scripting elements
 Scriptlet
 Regular Java code
 Expression
 Shortcut for output
 Declaration
 Declaring variables and methods at the class level
 Directive
 JSP action
 Comments (<%-- … --%>)
8
Scriptlets
 Wraps regular Java statements which are usually written
within a method
<%
… (Java statements)
// may include comments, variable declaration and assignment, loops,
conditional statements, object initialization, method call, etc…
%>
 Using the implicit object “out” as the standard output
out.println( … ) or out.print( … )
See example “scriptlet-example.jsp”
9
Expression
 A shortcut to print out a value or an
expression
<%= [expression]%>
Expression can be a variable, formula, object
property, string concatenation, method with
return value, or anything that returns a value
See example “expression-example.jsp”
10
Declarations
 Declaration element is used to define member variables
and methods
<%! … %>
 Variables not defined in declaration element are local / method
level variables
 Methods can only be defined in the declaration element
 Like regular class variables and methods, the location
where you define these variables and methods is not
important
See example “declaration.jsp”
11
JSP Page Directive
 Directives affects the overall structure of the
servlet generated
<%@ … %>
 Use page directive to import classes
<%@ page import=“…, …, …”%>
 This is equivalent to the “import” statement in regular
Java classes

More Related Content

PPTX
Servlets
PPT
Introduction to java beans
PDF
Asp.net mvc basic introduction
PPT
PPTX
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
PPTX
Ajax
PPTX
Php.ppt
PPT
Developing an ASP.NET Web Application
Servlets
Introduction to java beans
Asp.net mvc basic introduction
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
Ajax
Php.ppt
Developing an ASP.NET Web Application

What's hot (20)

PPTX
Operators php
PPT
Jsp ppt
PPTX
Asp objects
PPTX
Event In JavaScript
PPTX
Java servlets and CGI
PPT
Java Servlets
PPTX
Php string function
PPTX
Unit ii java script and xhtml documents and dynamic documents with javascript
PPTX
PPTX
Entity Relationship Model
PPT
Scripting languages
PPT
Advanced java
 
PPTX
Java applet
PPTX
graphics programming in java
PPTX
anatomy of a jsp page & jsp syntax.pptx
PPTX
Event Handling in java
PDF
Java I/o streams
PPTX
Method overloading
PPT
Servlet life cycle
Operators php
Jsp ppt
Asp objects
Event In JavaScript
Java servlets and CGI
Java Servlets
Php string function
Unit ii java script and xhtml documents and dynamic documents with javascript
Entity Relationship Model
Scripting languages
Advanced java
 
Java applet
graphics programming in java
anatomy of a jsp page & jsp syntax.pptx
Event Handling in java
Java I/o streams
Method overloading
Servlet life cycle
Ad

Similar to JSP Processing (20)

PPTX
JSP Directives
PDF
Java Web Programming [4/9] : JSP Basic
PPTX
JSP.pptx
PPTX
JSP - Java Server Page
PPTX
SCWCD : Java server pages CHAP : 9
PPTX
JSP- JAVA SERVER PAGES
PPTX
JSP AND XML USING JAVA WITH GET AND POST METHODS
PPTX
PPTX
Jsp basic
PPTX
JAVA SERVER PAGES
PPT
3.jsp tutorial
PPTX
WT Unit-Vuufvmjn dissimilating Dunkirk k
PPTX
Java Server Pages
PPT
Jsp intro
PPTX
JavaScript, often abbreviated as JS, is a programming language and core techn...
PDF
DOCX
Java server pages
PPT
Jsp sasidhar
PPTX
Introduction - Java Server Programming (JSP)
PPTX
Web programming-Introduction to JSP.pptx
JSP Directives
Java Web Programming [4/9] : JSP Basic
JSP.pptx
JSP - Java Server Page
SCWCD : Java server pages CHAP : 9
JSP- JAVA SERVER PAGES
JSP AND XML USING JAVA WITH GET AND POST METHODS
Jsp basic
JAVA SERVER PAGES
3.jsp tutorial
WT Unit-Vuufvmjn dissimilating Dunkirk k
Java Server Pages
Jsp intro
JavaScript, often abbreviated as JS, is a programming language and core techn...
Java server pages
Jsp sasidhar
Introduction - Java Server Programming (JSP)
Web programming-Introduction to JSP.pptx
Ad

More from Sadhana28 (12)

PPTX
Study of fluids
PPT
segmentation
PPTX
colorimage
PPTX
kerberos
PPTX
Class and object_diagram
PPT
Digital signature
PPTX
Adjustment of inheritance
PPT
Inferno operating system
PPTX
Process monitoring and_audit_sadhana
PPTX
Bluejacking sadhana
PPTX
Dhtml
PPTX
Quality attributes sadhana
Study of fluids
segmentation
colorimage
kerberos
Class and object_diagram
Digital signature
Adjustment of inheritance
Inferno operating system
Process monitoring and_audit_sadhana
Bluejacking sadhana
Dhtml
Quality attributes sadhana

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Modernizing your data center with Dell and AMD
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
KodekX | Application Modernization Development
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Monthly Chronicles - July 2025
Modernizing your data center with Dell and AMD
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx

JSP Processing

  • 1. JSP Processing 1 Submitted by - Sadhana Singh Shri Ram Murti Smarak College of Engg. & Tech.
  • 2. 2 JSP Pages  JSP page file ends with “.jsp” by default  JSP pages are organized like any other HTML files using the normal directory/file structure  A JSP page is usually composed of regular HTML tags and JSP scripting elements  JSP page is implicitly compiled to servlet class and loaded into memory  when the page is requested the first time after creation, or  when the page is requested the first time after modification  Refer to table 10.1 in the textbook and the next slide
  • 3. Model-View-Controller  A Design Pattern  Controller -- receives user interface input, updates data model  Model -- represents state of the world (e.g. shopping cart)  View -- looks at model and generates an appropriate user interface to present the data and allow for further input 3
  • 6. 6 JSP Compilation and Execution JSP Page Compile JSP Servlet Instance in Memory init() service() First request after creation or modification Subsequent Requests (can be from different users and sessions) JSP Servlet Automatic Compilation
  • 7. 7 JSP Elements  Scripting elements  Scriptlet  Regular Java code  Expression  Shortcut for output  Declaration  Declaring variables and methods at the class level  Directive  JSP action  Comments (<%-- … --%>)
  • 8. 8 Scriptlets  Wraps regular Java statements which are usually written within a method <% … (Java statements) // may include comments, variable declaration and assignment, loops, conditional statements, object initialization, method call, etc… %>  Using the implicit object “out” as the standard output out.println( … ) or out.print( … ) See example “scriptlet-example.jsp”
  • 9. 9 Expression  A shortcut to print out a value or an expression <%= [expression]%> Expression can be a variable, formula, object property, string concatenation, method with return value, or anything that returns a value See example “expression-example.jsp”
  • 10. 10 Declarations  Declaration element is used to define member variables and methods <%! … %>  Variables not defined in declaration element are local / method level variables  Methods can only be defined in the declaration element  Like regular class variables and methods, the location where you define these variables and methods is not important See example “declaration.jsp”
  • 11. 11 JSP Page Directive  Directives affects the overall structure of the servlet generated <%@ … %>  Use page directive to import classes <%@ page import=“…, …, …”%>  This is equivalent to the “import” statement in regular Java classes

Editor's Notes

  • #3: Show web-inf and jsp servlets
  • #7: For protocol architecture, refer to any network or telecommunication books