SlideShare a Scribd company logo
Web Component Development
with Servlet & JSP Technologies
(EE 6)
Module-7: Developing JSP Pages
www.webstackacademy.com
Objectives
Upon completion of this module, you should be able
to:
● Describe JSP page technology
● Write JSP code using scripting elements
● Write JSP code using the page directive
● Write JSP code using standard tags
● Write JSP code using the EL
● Configure the JSP page environment in the web.xml
file
www.webstackacademy.com
Relevance
Discussion – The following questions are relevant to
understanding JSP technology:
● What problems exist in generating an HTML response
in a servlet?
● How do template page technologies (and JSP
technology in
particular) solve these problems?
www.webstackacademy.com
How a JSP Page Is
Processed
A JSP page is essentially source code, and must be converted into a
servlet before it can service requests. Figure shows the steps of JSP
page processing.
www.webstackacademy.com
Writing JSP Scripting
Elements
JSP scripting elements are embedded with the <% %> tags and are
processed by the JSP engine during translation of the JSP page. Any
other
text in the JSP page is considered part of the response and is copied
verbatim to the HTTP response stream that is sent to the web
browser.
<html>
<%-- scripting element --%>
</html>
www.webstackacademy.com
Writing JSP
Scripting Elements
www.webstackacademy.com
Comments
HTML Comment:
<!-- This is an HTML comment. It will show up in the response. -->
JSP Comment:
<%-- This is a JSP comment. It will only be seen in the JSP m code.
It will not show up in either the servlet code or the response.--%>
Java Comment:
<%
/* This is java comment and it will only be seen in servlet.It will not
show in response. */
%>
www.webstackacademy.com
Implicit Variables
The JSP engine gives you access to the following implicit
variables, also called implicit objects, in scriptlet and
expression tags. These variables represent commonly
used objects for servlets that JSP page developers might
need to use. For example, you can retrieve HTML form
parameter data by using the request variable, which
represents the HttpServletRequest object.
www.webstackacademy.com
Implicit Variables
Request
Response
Out
Session
Application
Config
PageContext
Page
Exception
www.webstackacademy.com
Using the page
Directive
You use the page directive to modify the overall
translation of the JSP page. For example, you can
declare that the servlet code generated from a JSP
page requires the use of the Date class:
<%@ page import=”java.util.Date” %>
www.webstackacademy.com
Including JSP Page
Segments
There are two standard approaches to including
presentation segments in your JSP pages:
● The include directive
● The jsp:include standard action
www.webstackacademy.com
Using the include
Directive
The include directive lets you include a segment in the text
of the main JSP page at translation time. The syntax of this
JSP technology directive is as follows:
<%@ include file=”segmentURL” %>
www.webstackacademy.com
Using Standard Tags
● The JSP specification provides standard tags for use
within your JSP pages. Because these tags are
required in the specification, every JSP container
must support them. This ensures that any
applications using the standard tags will work in any
compliant JSP container.
● Standard tags begin with the jsp: prefix. You use
these tags to reduce or eliminate scriptlet code
within your JSP page. However, the standard tags
only provide limited functionality. Using the JSTL and
EL reduces the need for the standard tags.
www.webstackacademy.com
JavaBeans
Components
A JavaBeans component is a Java technology class with at
minimum the following features:
● Properties defined with accessors and mutators (get and
set methods).
● A no-argument constructor.
● No public instance variables.
● The class implements the java.io.Serializable interface.
www.webstackacademy.com
The useBean Tag
If you want to interact with a JavaBeans component using the
standard
tags in a JSP page, you must first declare the bean. You do this
by using
the useBean standard tag.
The syntax of the useBean tag is as follows:
<jsp:useBean id=”beanName”
scope=”page | request | session | application”
class=”className” />
The id attribute specifies the attribute name of the bean. Where
the bean is stored is specified by the scope attribute. Scope
defaults to page if not specified. The class attribute specifies the
fully qualified class name.
www.webstackacademy.com
The setProperty Tag
● You use the setProperty tag to store data in the JavaBeans
instance. The syntax of the setProperty tag is as follows:
<jsp:setProperty name="beanName" property_expression/>
● The property attribute specifies the property within the bean that
will be set. For example, to set the email property in the customer
bean, you can use the following:
<jsp:setProperty name=”cust” property=”email” />
www.webstackacademy.com
The getProperty Tag
The getProperty tag is used to retrieve a property from a
JavaBeans instance and display it in the output stream.
The syntax of the getProperty tag is as follows:
<jsp:getProperty name=”beanName”
property=”propertyName” />
The name attribute specifies the name of the JavaBeans instance
and the property attribute specifies the property used for the get
method.
Given a getProperty usage of the following:
<jsp:getProperty name=”cust” property=”email” />
www.webstackacademy.com
Other Standard Tags
www.webstackacademy.com
Other Standard Tags
www.webstackacademy.com
Using the jsp:include
Standard Action
● The jsp:include standard action lets you include a segment
in the text of the main JSP page at runtime. The syntax of
this JSP technology action tag is as follows:
<jsp:include page=”segmentURL” />
● You might have noticed that the include directive uses an
attribute called file and the jsp:include standard action uses
an attribute called page. These attributes represent the
same concept: The URL to the segment file to be included.
● The jsp:include action is equivalent to using the include
method on a RequestDispatcher object. For example:
RequestDispatcher segment =
request.getRequestDispatcher(page);
segment.include(request, response);
www.webstackacademy.com
Using the jsp:include
Standard Action
● The jsp:include standard action lets you include a segment
in the text of the main JSP page at runtime. The syntax of
this JSP technology action tag is as follows:
<jsp:include page=”segmentURL” />
● You might have noticed that the include directive uses an
attribute called file and the jsp:include standard action uses
an attribute called page. These attributes represent the
same concept: The URL to the segment file to be included.
● The jsp:include action is equivalent to using the include
method on a RequestDispatcher object. For example:
RequestDispatcher segment =
request.getRequestDispatcher(page);
segment.include(request, response);
www.webstackacademy.com
Using the jsp:param
Standard Action
Sometimes, you might want to alter a presentation
segment at runtime.
The jsp:include action lets you pass additional
parameters to the presentation segment at runtime
using the jsp:param standard action. The syntax of
this JSP technology action tag and the relationship to
the jsp:include action is:
<jsp:include page=”segmentURL”>
<jsp:param name=”paramName”
value=”paramValue”/>
</jsp:include>
www.webstackacademy.com
Using the jsp:param
Standard Action
<!-- START of banner -->
<jsp:include page=”/WEB-INF/view/common/banner.jsp”>
<jsp:param name=”subTitle” value=”Registration” />
</jsp:include>
<!-- END of banner -->
Web Stack Academy (P) Ltd
#83, Farah Towers,
1st floor,MG Road,
Bangalore – 560001
M: +91-80-4128 9576
T: +91-98862 69112
E: info@www.webstackacademy.com
www.webstackacademy.com
Ad

More Related Content

What's hot (20)

Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
Kasun Madusanke
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
Darshit Metaliya
 
JSP
JSPJSP
JSP
vikram singh
 
Jsp element
Jsp elementJsp element
Jsp element
kamal kotecha
 
Jsp presentation
Jsp presentationJsp presentation
Jsp presentation
Sher Singh Bardhan
 
Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
kamal kotecha
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap
 
JAVA SERVER PAGES
JAVA SERVER PAGESJAVA SERVER PAGES
JAVA SERVER PAGES
Kalpana T
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
ejjavies
 
Jsp
JspJsp
Jsp
Mumbai Academisc
 
Implicit object.pptx
Implicit object.pptxImplicit object.pptx
Implicit object.pptx
chakrapani tripathi
 
Jsp tutorial (1)
Jsp tutorial (1)Jsp tutorial (1)
Jsp tutorial (1)
Reliance Jio USA, Inc.
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
APSMIND TECHNOLOGY PVT LTD.
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
vishal choudhary
 
JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server Page
Vipin Yadav
 
Intro To Sap Netweaver Java
Intro To Sap Netweaver JavaIntro To Sap Netweaver Java
Intro To Sap Netweaver Java
Leland Bartlett
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
Chitrank Dixit
 
Web&java. jsp
Web&java. jspWeb&java. jsp
Web&java. jsp
Asya Dudnik
 
Java server pages
Java server pagesJava server pages
Java server pages
Apoorv Anand
 
Java server pages
Java server pagesJava server pages
Java server pages
Tanmoy Barman
 

Similar to Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 - Developing JSP Pages (20)

Jsp in Servlet by Rj
Jsp in Servlet by RjJsp in Servlet by Rj
Jsp in Servlet by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Introduction to JSP.pptx
Introduction to JSP.pptxIntroduction to JSP.pptx
Introduction to JSP.pptx
ManishaPatil932723
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
Shah Nawaz Bhurt
 
JSP.pptx
JSP.pptxJSP.pptx
JSP.pptx
NishaRohit6
 
SCWCD : Java server pages CHAP : 9
SCWCD : Java server pages  CHAP : 9SCWCD : Java server pages  CHAP : 9
SCWCD : Java server pages CHAP : 9
Ben Abdallah Helmi
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
Yoga Raja
 
JSP APP DEVLOPMENT.pptx Related to Android App Development
JSP  APP DEVLOPMENT.pptx Related to Android App DevelopmentJSP  APP DEVLOPMENT.pptx Related to Android App Development
JSP APP DEVLOPMENT.pptx Related to Android App Development
BhawnaSaini45
 
JSP Technology I
JSP Technology IJSP Technology I
JSP Technology I
People Strategists
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Transformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern ApproachTransformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern Approach
IRJET Journal
 
JSP Part 2
JSP Part 2JSP Part 2
JSP Part 2
DeeptiJava
 
3.jsp tutorial
3.jsp tutorial3.jsp tutorial
3.jsp tutorial
shiva404
 
JSP Directives
JSP DirectivesJSP Directives
JSP Directives
ShahDhruv21
 
Jsp
JspJsp
Jsp
Rahul Goyal
 
Jsp
JspJsp
Jsp
Rahul Goyal
 
Module 3.pptx.............................
Module 3.pptx.............................Module 3.pptx.............................
Module 3.pptx.............................
Betty333100
 
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
JavaServer Pages Pocket Reference 1st Edition Hans BergstenJavaServer Pages Pocket Reference 1st Edition Hans Bergsten
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
jawajberwal
 
Jsp tutorial
Jsp tutorialJsp tutorial
Jsp tutorial
siddhesh2466
 
Learning jsp
Learning jspLearning jsp
Learning jsp
mustafacse2009
 
Jsp Presentation +Mufix "3"
Jsp Presentation +Mufix "3"Jsp Presentation +Mufix "3"
Jsp Presentation +Mufix "3"
SiliconExpert Technologies
 
SCWCD : Java server pages CHAP : 9
SCWCD : Java server pages  CHAP : 9SCWCD : Java server pages  CHAP : 9
SCWCD : Java server pages CHAP : 9
Ben Abdallah Helmi
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
Yoga Raja
 
JSP APP DEVLOPMENT.pptx Related to Android App Development
JSP  APP DEVLOPMENT.pptx Related to Android App DevelopmentJSP  APP DEVLOPMENT.pptx Related to Android App Development
JSP APP DEVLOPMENT.pptx Related to Android App Development
BhawnaSaini45
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Transformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern ApproachTransformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern Approach
IRJET Journal
 
3.jsp tutorial
3.jsp tutorial3.jsp tutorial
3.jsp tutorial
shiva404
 
Module 3.pptx.............................
Module 3.pptx.............................Module 3.pptx.............................
Module 3.pptx.............................
Betty333100
 
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
JavaServer Pages Pocket Reference 1st Edition Hans BergstenJavaServer Pages Pocket Reference 1st Edition Hans Bergsten
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
jawajberwal
 
Ad

More from WebStackAcademy (20)

Webstack Academy - Course Demo Webinar and Placement Journey
Webstack Academy - Course Demo Webinar and Placement JourneyWebstack Academy - Course Demo Webinar and Placement Journey
Webstack Academy - Course Demo Webinar and Placement Journey
WebStackAcademy
 
WSA: Scaling Web Service to Handle Millions of Requests per Second
WSA: Scaling Web Service to Handle Millions of Requests per SecondWSA: Scaling Web Service to Handle Millions of Requests per Second
WSA: Scaling Web Service to Handle Millions of Requests per Second
WebStackAcademy
 
WSA: Course Demo Webinar - Full Stack Developer Course
WSA: Course Demo Webinar - Full Stack Developer CourseWSA: Course Demo Webinar - Full Stack Developer Course
WSA: Course Demo Webinar - Full Stack Developer Course
WebStackAcademy
 
Career Building in AI - Technologies, Trends and Opportunities
Career Building in AI - Technologies, Trends and OpportunitiesCareer Building in AI - Technologies, Trends and Opportunities
Career Building in AI - Technologies, Trends and Opportunities
WebStackAcademy
 
Webstack Academy - Internship Kick Off
Webstack Academy - Internship Kick OffWebstack Academy - Internship Kick Off
Webstack Academy - Internship Kick Off
WebStackAcademy
 
Building Your Online Portfolio
Building Your Online PortfolioBuilding Your Online Portfolio
Building Your Online Portfolio
WebStackAcademy
 
Front-End Developer's Career Roadmap
Front-End Developer's Career RoadmapFront-End Developer's Career Roadmap
Front-End Developer's Career Roadmap
WebStackAcademy
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and Authorization
WebStackAcademy
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
WebStackAcademy
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
WebStackAcademy
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming
WebStackAcademy
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
WebStackAcademy
 
JavaScript - Chapter 10 - Strings and Arrays
 JavaScript - Chapter 10 - Strings and Arrays JavaScript - Chapter 10 - Strings and Arrays
JavaScript - Chapter 10 - Strings and Arrays
WebStackAcademy
 
JavaScript - Chapter 15 - Debugging Techniques
 JavaScript - Chapter 15 - Debugging Techniques JavaScript - Chapter 15 - Debugging Techniques
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
JavaScript - Chapter 14 - Form Handling
 JavaScript - Chapter 14 - Form Handling   JavaScript - Chapter 14 - Form Handling
JavaScript - Chapter 14 - Form Handling
WebStackAcademy
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Webstack Academy - Course Demo Webinar and Placement Journey
Webstack Academy - Course Demo Webinar and Placement JourneyWebstack Academy - Course Demo Webinar and Placement Journey
Webstack Academy - Course Demo Webinar and Placement Journey
WebStackAcademy
 
WSA: Scaling Web Service to Handle Millions of Requests per Second
WSA: Scaling Web Service to Handle Millions of Requests per SecondWSA: Scaling Web Service to Handle Millions of Requests per Second
WSA: Scaling Web Service to Handle Millions of Requests per Second
WebStackAcademy
 
WSA: Course Demo Webinar - Full Stack Developer Course
WSA: Course Demo Webinar - Full Stack Developer CourseWSA: Course Demo Webinar - Full Stack Developer Course
WSA: Course Demo Webinar - Full Stack Developer Course
WebStackAcademy
 
Career Building in AI - Technologies, Trends and Opportunities
Career Building in AI - Technologies, Trends and OpportunitiesCareer Building in AI - Technologies, Trends and Opportunities
Career Building in AI - Technologies, Trends and Opportunities
WebStackAcademy
 
Webstack Academy - Internship Kick Off
Webstack Academy - Internship Kick OffWebstack Academy - Internship Kick Off
Webstack Academy - Internship Kick Off
WebStackAcademy
 
Building Your Online Portfolio
Building Your Online PortfolioBuilding Your Online Portfolio
Building Your Online Portfolio
WebStackAcademy
 
Front-End Developer's Career Roadmap
Front-End Developer's Career RoadmapFront-End Developer's Career Roadmap
Front-End Developer's Career Roadmap
WebStackAcademy
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and Authorization
WebStackAcademy
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
WebStackAcademy
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
WebStackAcademy
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming
WebStackAcademy
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
WebStackAcademy
 
JavaScript - Chapter 10 - Strings and Arrays
 JavaScript - Chapter 10 - Strings and Arrays JavaScript - Chapter 10 - Strings and Arrays
JavaScript - Chapter 10 - Strings and Arrays
WebStackAcademy
 
JavaScript - Chapter 15 - Debugging Techniques
 JavaScript - Chapter 15 - Debugging Techniques JavaScript - Chapter 15 - Debugging Techniques
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
JavaScript - Chapter 14 - Form Handling
 JavaScript - Chapter 14 - Form Handling   JavaScript - Chapter 14 - Form Handling
JavaScript - Chapter 14 - Form Handling
WebStackAcademy
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Ad

Recently uploaded (20)

Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 

Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 - Developing JSP Pages

  • 1. Web Component Development with Servlet & JSP Technologies (EE 6) Module-7: Developing JSP Pages
  • 2. www.webstackacademy.com Objectives Upon completion of this module, you should be able to: ● Describe JSP page technology ● Write JSP code using scripting elements ● Write JSP code using the page directive ● Write JSP code using standard tags ● Write JSP code using the EL ● Configure the JSP page environment in the web.xml file
  • 3. www.webstackacademy.com Relevance Discussion – The following questions are relevant to understanding JSP technology: ● What problems exist in generating an HTML response in a servlet? ● How do template page technologies (and JSP technology in particular) solve these problems?
  • 4. www.webstackacademy.com How a JSP Page Is Processed A JSP page is essentially source code, and must be converted into a servlet before it can service requests. Figure shows the steps of JSP page processing.
  • 5. www.webstackacademy.com Writing JSP Scripting Elements JSP scripting elements are embedded with the <% %> tags and are processed by the JSP engine during translation of the JSP page. Any other text in the JSP page is considered part of the response and is copied verbatim to the HTTP response stream that is sent to the web browser. <html> <%-- scripting element --%> </html>
  • 7. www.webstackacademy.com Comments HTML Comment: <!-- This is an HTML comment. It will show up in the response. --> JSP Comment: <%-- This is a JSP comment. It will only be seen in the JSP m code. It will not show up in either the servlet code or the response.--%> Java Comment: <% /* This is java comment and it will only be seen in servlet.It will not show in response. */ %>
  • 8. www.webstackacademy.com Implicit Variables The JSP engine gives you access to the following implicit variables, also called implicit objects, in scriptlet and expression tags. These variables represent commonly used objects for servlets that JSP page developers might need to use. For example, you can retrieve HTML form parameter data by using the request variable, which represents the HttpServletRequest object.
  • 10. www.webstackacademy.com Using the page Directive You use the page directive to modify the overall translation of the JSP page. For example, you can declare that the servlet code generated from a JSP page requires the use of the Date class: <%@ page import=”java.util.Date” %>
  • 11. www.webstackacademy.com Including JSP Page Segments There are two standard approaches to including presentation segments in your JSP pages: ● The include directive ● The jsp:include standard action
  • 12. www.webstackacademy.com Using the include Directive The include directive lets you include a segment in the text of the main JSP page at translation time. The syntax of this JSP technology directive is as follows: <%@ include file=”segmentURL” %>
  • 13. www.webstackacademy.com Using Standard Tags ● The JSP specification provides standard tags for use within your JSP pages. Because these tags are required in the specification, every JSP container must support them. This ensures that any applications using the standard tags will work in any compliant JSP container. ● Standard tags begin with the jsp: prefix. You use these tags to reduce or eliminate scriptlet code within your JSP page. However, the standard tags only provide limited functionality. Using the JSTL and EL reduces the need for the standard tags.
  • 14. www.webstackacademy.com JavaBeans Components A JavaBeans component is a Java technology class with at minimum the following features: ● Properties defined with accessors and mutators (get and set methods). ● A no-argument constructor. ● No public instance variables. ● The class implements the java.io.Serializable interface.
  • 15. www.webstackacademy.com The useBean Tag If you want to interact with a JavaBeans component using the standard tags in a JSP page, you must first declare the bean. You do this by using the useBean standard tag. The syntax of the useBean tag is as follows: <jsp:useBean id=”beanName” scope=”page | request | session | application” class=”className” /> The id attribute specifies the attribute name of the bean. Where the bean is stored is specified by the scope attribute. Scope defaults to page if not specified. The class attribute specifies the fully qualified class name.
  • 16. www.webstackacademy.com The setProperty Tag ● You use the setProperty tag to store data in the JavaBeans instance. The syntax of the setProperty tag is as follows: <jsp:setProperty name="beanName" property_expression/> ● The property attribute specifies the property within the bean that will be set. For example, to set the email property in the customer bean, you can use the following: <jsp:setProperty name=”cust” property=”email” />
  • 17. www.webstackacademy.com The getProperty Tag The getProperty tag is used to retrieve a property from a JavaBeans instance and display it in the output stream. The syntax of the getProperty tag is as follows: <jsp:getProperty name=”beanName” property=”propertyName” /> The name attribute specifies the name of the JavaBeans instance and the property attribute specifies the property used for the get method. Given a getProperty usage of the following: <jsp:getProperty name=”cust” property=”email” />
  • 20. www.webstackacademy.com Using the jsp:include Standard Action ● The jsp:include standard action lets you include a segment in the text of the main JSP page at runtime. The syntax of this JSP technology action tag is as follows: <jsp:include page=”segmentURL” /> ● You might have noticed that the include directive uses an attribute called file and the jsp:include standard action uses an attribute called page. These attributes represent the same concept: The URL to the segment file to be included. ● The jsp:include action is equivalent to using the include method on a RequestDispatcher object. For example: RequestDispatcher segment = request.getRequestDispatcher(page); segment.include(request, response);
  • 21. www.webstackacademy.com Using the jsp:include Standard Action ● The jsp:include standard action lets you include a segment in the text of the main JSP page at runtime. The syntax of this JSP technology action tag is as follows: <jsp:include page=”segmentURL” /> ● You might have noticed that the include directive uses an attribute called file and the jsp:include standard action uses an attribute called page. These attributes represent the same concept: The URL to the segment file to be included. ● The jsp:include action is equivalent to using the include method on a RequestDispatcher object. For example: RequestDispatcher segment = request.getRequestDispatcher(page); segment.include(request, response);
  • 22. www.webstackacademy.com Using the jsp:param Standard Action Sometimes, you might want to alter a presentation segment at runtime. The jsp:include action lets you pass additional parameters to the presentation segment at runtime using the jsp:param standard action. The syntax of this JSP technology action tag and the relationship to the jsp:include action is: <jsp:include page=”segmentURL”> <jsp:param name=”paramName” value=”paramValue”/> </jsp:include>
  • 23. www.webstackacademy.com Using the jsp:param Standard Action <!-- START of banner --> <jsp:include page=”/WEB-INF/view/common/banner.jsp”> <jsp:param name=”subTitle” value=”Registration” /> </jsp:include> <!-- END of banner -->
  • 24. Web Stack Academy (P) Ltd #83, Farah Towers, 1st floor,MG Road, Bangalore – 560001 M: +91-80-4128 9576 T: +91-98862 69112 E: info@www.webstackacademy.com www.webstackacademy.com
  翻译: