SlideShare a Scribd company logo
1 of 11
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

What's hot (20)

ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
 
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSINGINTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
 
Error managing and exception handling in java
Error managing and exception handling in javaError managing and exception handling in java
Error managing and exception handling in java
 
Webservices
WebservicesWebservices
Webservices
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Active x control
Active x controlActive x control
Active x control
 
Applets in java
Applets in javaApplets in java
Applets in java
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Asp net
Asp netAsp net
Asp net
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Software Engineering by Pankaj Jalote
Software Engineering by Pankaj JaloteSoftware Engineering by Pankaj Jalote
Software Engineering by Pankaj Jalote
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 

Similar to JSP Processing

JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server PageVipin Yadav
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESYoga Raja
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsKaml Sah
 
Java Web Programming [4/9] : JSP Basic
Java Web Programming [4/9] : JSP BasicJava Web Programming [4/9] : JSP Basic
Java Web Programming [4/9] : JSP BasicIMC Institute
 
Session 5 : intro to jsp - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp  - Giáo trình Bách Khoa AptechSession 5 : intro to jsp  - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp - Giáo trình Bách Khoa AptechMasterCode.vn
 
JSP Components and Directives.pdf
JSP Components and Directives.pdfJSP Components and Directives.pdf
JSP Components and Directives.pdfArumugam90
 
Introduction to JSP pages
Introduction to JSP pagesIntroduction to JSP pages
Introduction to JSP pagesFulvio Corno
 
Atul & shubha goswami jsp
Atul & shubha goswami jspAtul & shubha goswami jsp
Atul & shubha goswami jspAtul Giri
 
AK 5 JSF 21 july 2008
AK 5 JSF   21 july 2008AK 5 JSF   21 july 2008
AK 5 JSF 21 july 2008gauravashq
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsBG Java EE Course
 

Similar to JSP Processing (20)

JSP.pptx
JSP.pptxJSP.pptx
JSP.pptx
 
JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server Page
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
Java Web Programming [4/9] : JSP Basic
Java Web Programming [4/9] : JSP BasicJava Web Programming [4/9] : JSP Basic
Java Web Programming [4/9] : JSP Basic
 
Session 5 : intro to jsp - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp  - Giáo trình Bách Khoa AptechSession 5 : intro to jsp  - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp - Giáo trình Bách Khoa Aptech
 
Jsp
JspJsp
Jsp
 
Introduction to jsp
Introduction to jspIntroduction to jsp
Introduction to jsp
 
Introduction to jsp
Introduction to jspIntroduction to jsp
Introduction to jsp
 
Java server pages
Java server pagesJava server pages
Java server pages
 
JSP Components and Directives.pdf
JSP Components and Directives.pdfJSP Components and Directives.pdf
JSP Components and Directives.pdf
 
Introduction to JSP pages
Introduction to JSP pagesIntroduction to JSP pages
Introduction to JSP pages
 
Atul & shubha goswami jsp
Atul & shubha goswami jspAtul & shubha goswami jsp
Atul & shubha goswami jsp
 
Unit 4 web technology uptu
Unit 4 web technology uptuUnit 4 web technology uptu
Unit 4 web technology uptu
 
Unit 4 1 web technology uptu
Unit 4 1 web technology uptuUnit 4 1 web technology uptu
Unit 4 1 web technology uptu
 
Introduction to JSP.pptx
Introduction to JSP.pptxIntroduction to JSP.pptx
Introduction to JSP.pptx
 
AK 5 JSF 21 july 2008
AK 5 JSF   21 july 2008AK 5 JSF   21 july 2008
AK 5 JSF 21 july 2008
 
AK 4 JSF
AK 4 JSFAK 4 JSF
AK 4 JSF
 
Chap4 4 2
Chap4 4 2Chap4 4 2
Chap4 4 2
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 

More from Sadhana28

Study of fluids
Study of fluidsStudy of fluids
Study of fluidsSadhana28
 
segmentation
segmentationsegmentation
segmentationSadhana28
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagramSadhana28
 
Digital signature
Digital signatureDigital signature
Digital signatureSadhana28
 
Adjustment of inheritance
Adjustment of inheritanceAdjustment of inheritance
Adjustment of inheritanceSadhana28
 
Inferno operating system
Inferno operating systemInferno operating system
Inferno operating systemSadhana28
 
Process monitoring and_audit_sadhana
Process monitoring and_audit_sadhanaProcess monitoring and_audit_sadhana
Process monitoring and_audit_sadhanaSadhana28
 
Bluejacking sadhana
Bluejacking sadhanaBluejacking sadhana
Bluejacking sadhanaSadhana28
 
Quality attributes sadhana
Quality attributes sadhanaQuality attributes sadhana
Quality attributes sadhanaSadhana28
 

More from Sadhana28 (12)

Study of fluids
Study of fluidsStudy of fluids
Study of fluids
 
segmentation
segmentationsegmentation
segmentation
 
colorimage
colorimagecolorimage
colorimage
 
kerberos
kerberoskerberos
kerberos
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagram
 
Digital signature
Digital signatureDigital signature
Digital signature
 
Adjustment of inheritance
Adjustment of inheritanceAdjustment of inheritance
Adjustment of inheritance
 
Inferno operating system
Inferno operating systemInferno operating system
Inferno operating system
 
Process monitoring and_audit_sadhana
Process monitoring and_audit_sadhanaProcess monitoring and_audit_sadhana
Process monitoring and_audit_sadhana
 
Bluejacking sadhana
Bluejacking sadhanaBluejacking sadhana
Bluejacking sadhana
 
Dhtml
DhtmlDhtml
Dhtml
 
Quality attributes sadhana
Quality attributes sadhanaQuality attributes sadhana
Quality attributes sadhana
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 

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

  1. Show web-inf and jsp servlets
  2. For protocol architecture, refer to any network or telecommunication books