SlideShare a Scribd company logo
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Topics to be covered
01
02
03
05
06
07
Introduction to Web
Introduction to Servlets
Generic Servlets
Introduction to JSP
Steps to create JSP
JSP Scripting & Directive
Elements
04 08Session Tracking Java Bean Class
Introduction to
WEB
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Web & HTTP
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Web & HTTP
HTTP is a protocol that clients and servers use
on the web to communicate.
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
HTTP Request & Response
HTTP Request
HTTP Response
Client Server
HTTP Response is the packet of information sent by Server to the Client
in response to an earlier Request made by Client
HTTP Request is a packet of Information that one computer sends to another
computer to communicate something
Introduction to
Servlets
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
What are Servlets?
Creates Web Application
Provides Interfaces & Classes
Must be implemented to create Servlet
Robust & Scalable
Deployed to create Web Page
Responds to any incoming requests
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
What are Servlets?
Request
Response is generated at runtimeResponse is sent to client
Client Server
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Servlet Life Cycle
Handling Request
Loading &
Instantiation
Initialized
End
Start
Stop
init()
service()
destroy()
End of
Request
thread
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Steps to create Simple Servlet
Create and compile simple servlet code
1
Start Apache Tomcat
3
Add mappings to web.xml file
2
Start Web Browser & Request Servlet
4
Generic Servlet
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Generic Servlet
A generic servlet is a
protocol independent
Servlet that should always
override the service()
method to handle the client
request..
Generic Servlet is
easier to write
It has a very simple life cycle
methods
To write Generic Servlet you just
need to extend
javax.servlet.GenericServlet and
override the service() method
Pros
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Servlet Classes & Interfaces
Servlet Declares life cycle method of servlet
ServletConfig Allows servlet to get Initialization methods
ServletContext Enables servlet to log access and access information
ServletRequest Used to read data from client request
ServletResponse Used to write data to client response
GenericServlet Implements servlet and Servlet.Config Interface
ServletInputStream Provides input stream to read requests from the client
ServletOutputStream Provides output stream to write responses to the client
ServletException Indicates servlet error has occured
UnavailableException Indicates servlet is not available
HttpServlet Provides methods to handle Http Request and Response
HttpServletRequest Enables servlets to read data from Http Request
HttpServletResponse Enables servlets to write data to Http Response
Session Tracking
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Session Tracking in Servlets
Session tracking is a way to maintain state(data) of an user
1. Request(new)
3. Second new request
2. Response
Client
Server
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Cookies
URL
rewriting
Hidden
form field
Http
session
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Cookies in Servlet
It is a small piece of information that is persisted between the multiple client requests
1. Request
2. Request + Cookies
3. Response + Cookies
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Useful Methods of Cookie Class
public void setMaxAge(int expiry) Sets the maximum age of the cookies in seconds
public String getName() Returns the name of the cookie. Name cannot be changed after creation
public String getValue() Returns the value of the cookie
public void setName(String name) Changes the name of the cookie
public void setValue(String value) Changes the value of the cookie
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Creating & Deleting a Cookie
Deletion
Creation
1.Cookie ck=new Cookie("user",“Edureka");//creating cookie object
2.response.addCookie(ck);//adding cookie in the response
1.Cookie ck=new Cookie("user","");//deleting value of cookie
2.ck.setMaxAge(0);//changing the maximum age to 0 seconds
3.response.addCookie(ck);//adding cookie in the response
Introduction to
jsp
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
What is JSP?
It is used to create web application just like Servlet technology. Also called as extension of servlet
Fast Development
Tracking User
Easy to maintain
Portable
Powerful
Flexible
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Advantages of JSP over Servlets
JSP
Operation
Servlets
▪ Extension to Servlet ▪ It is not a extension of JSP
▪ No need to recompile and redeploy ▪ Code needs to be recompiled
▪ Less code than servlet ▪ More code comparatively
▪ Easy to maintain ▪ Bit complicated
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Life Cycle of JSP
Buffer
(dynamic content)
Servlet Object
JRE
JSP
Servlet (.java File)
Class file
Compiler
JSP Translator
Steps to create jsp
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Steps to create JSP Page
Create dynamic web project
1
Start Apache Tomcat
3
Create JSP File
2
Deploy the project and get the output
4
Jsp Scripting &
Directive elements
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
JSP Scripting Elements
<% java source code %>scriptlet
<%= statement %>expression
<%! field or method declaration %>declaration
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Implicit Objects of JSP
out Jspwriter
request HttpServletrequest
response HttpServletResponse
config ServletConfig
application ServletContext
session HttpSession
pageContent PageContext
page Object
exception Throwable
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
JSP Directive Elements
<%@ page directive="value” %>Page directive
<%@ include file="resourceName" %>Include directive
<%@ taglib uri="uriofthetaglibrary" prefix="prefixoftaglibrary" %>Taglib directive
Java bean class
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Java Bean Class
It is a reusable software component. A bean encapsulates many objects into one object, so we can access
this object from multiple places. Moreover, it provides the easy maintenance.
1.<jsp:useBean id= "instanceName" scope= "page | request
| session | application"
2.class= "packageName.className" type= "packageName.clas
sName"
3.beanName="packageName.className | <%= expression >" >
4.</jsp:useBean>
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification Training | Edureka

More Related Content

What's hot (20)

PDF
JavaOne 2011: Migrating Spring Applications to Java EE 6
Bert Ertman
 
PPT
Java EE Introduction
ejlp12
 
PPT
What's New in WebLogic 12.1.3 and Beyond
Oracle
 
PPT
Java EE7 in action
Ankara JUG
 
PPT
Have You Seen Java EE Lately?
Reza Rahman
 
PDF
JavaFX Uni Parthenope
Emanuela Giannetta
 
PDF
Java EE 01-Servlets and Containers
Fernando Gil
 
PPT
JEE Course - JEE Overview
odedns
 
PPTX
JavaFX and JEE 7
Vijay Nair
 
PPT
Ankara JUG Ağustos 2013 - Oracle ADF
Ankara JUG
 
PPT
Rich Enterprise Applications with JavaFX
Max Katz
 
PDF
Java Enterprise Edition 6 Overview
Eugene Bogaart
 
PDF
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Edureka!
 
PPTX
Advanced JAVA
Rajvi Vaghasiya
 
PDF
Java EE 8: On the Horizon
Josh Juneau
 
PDF
108 advancedjava
Anil Kumar
 
PPTX
Move from J2EE to Java EE
Hirofumi Iwasaki
 
PDF
jDays2015 - JavaEE vs. Spring Smackdown
Mert Çalışkan
 
PPTX
Java EE vs Spring Framework
Rohit Kelapure
 
PDF
Java EE 8 Recipes
Josh Juneau
 
JavaOne 2011: Migrating Spring Applications to Java EE 6
Bert Ertman
 
Java EE Introduction
ejlp12
 
What's New in WebLogic 12.1.3 and Beyond
Oracle
 
Java EE7 in action
Ankara JUG
 
Have You Seen Java EE Lately?
Reza Rahman
 
JavaFX Uni Parthenope
Emanuela Giannetta
 
Java EE 01-Servlets and Containers
Fernando Gil
 
JEE Course - JEE Overview
odedns
 
JavaFX and JEE 7
Vijay Nair
 
Ankara JUG Ağustos 2013 - Oracle ADF
Ankara JUG
 
Rich Enterprise Applications with JavaFX
Max Katz
 
Java Enterprise Edition 6 Overview
Eugene Bogaart
 
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Edureka!
 
Advanced JAVA
Rajvi Vaghasiya
 
Java EE 8: On the Horizon
Josh Juneau
 
108 advancedjava
Anil Kumar
 
Move from J2EE to Java EE
Hirofumi Iwasaki
 
jDays2015 - JavaEE vs. Spring Smackdown
Mert Çalışkan
 
Java EE vs Spring Framework
Rohit Kelapure
 
Java EE 8 Recipes
Josh Juneau
 

Similar to Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification Training | Edureka (20)

PDF
Bt0083 server side programing
Techglyphs
 
PPTX
IP UNIT III PPT.pptx
ssuser92282c
 
PDF
Ajax basics
amanrahulraj
 
PDF
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
PPTX
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
PPTX
java Servlet technology
Tanmoy Barman
 
PPTX
Advanced java+JDBC+Servlet
Anuj Singh Rajput
 
PPTX
SERVIET
sathish sak
 
PPTX
Servlets
Geethu Mohan
 
PDF
Ajax Basics 1
bhuvanann
 
PPT
Java servlet life cycle - methods ppt
kamal kotecha
 
PDF
005428052.pdf
KalsoomTahir2
 
PDF
Java Servlets.pdf
Arumugam90
 
PPT
Chap4 4 1
Hemo Chella
 
PPTX
UNIT-3 Servlet
ssbd6985
 
PPT
Ppt for Online music store
ADEEBANADEEM
 
PPTX
CS8651 IP Unit 3.pptx
Vigneshkumar Ponnusamy
 
PDF
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 
PPT
Java servlets
lopjuan
 
Bt0083 server side programing
Techglyphs
 
IP UNIT III PPT.pptx
ssuser92282c
 
Ajax basics
amanrahulraj
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
java Servlet technology
Tanmoy Barman
 
Advanced java+JDBC+Servlet
Anuj Singh Rajput
 
SERVIET
sathish sak
 
Servlets
Geethu Mohan
 
Ajax Basics 1
bhuvanann
 
Java servlet life cycle - methods ppt
kamal kotecha
 
005428052.pdf
KalsoomTahir2
 
Java Servlets.pdf
Arumugam90
 
Chap4 4 1
Hemo Chella
 
UNIT-3 Servlet
ssbd6985
 
Ppt for Online music store
ADEEBANADEEM
 
CS8651 IP Unit 3.pptx
Vigneshkumar Ponnusamy
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 
Java servlets
lopjuan
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 

Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification Training | Edureka

  • 1. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
  • 2. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Topics to be covered 01 02 03 05 06 07 Introduction to Web Introduction to Servlets Generic Servlets Introduction to JSP Steps to create JSP JSP Scripting & Directive Elements 04 08Session Tracking Java Bean Class
  • 4. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Web & HTTP
  • 5. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Web & HTTP HTTP is a protocol that clients and servers use on the web to communicate.
  • 6. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training HTTP Request & Response HTTP Request HTTP Response Client Server HTTP Response is the packet of information sent by Server to the Client in response to an earlier Request made by Client HTTP Request is a packet of Information that one computer sends to another computer to communicate something
  • 8. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training What are Servlets? Creates Web Application Provides Interfaces & Classes Must be implemented to create Servlet Robust & Scalable Deployed to create Web Page Responds to any incoming requests
  • 9. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training What are Servlets? Request Response is generated at runtimeResponse is sent to client Client Server
  • 10. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Servlet Life Cycle Handling Request Loading & Instantiation Initialized End Start Stop init() service() destroy() End of Request thread
  • 11. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Steps to create Simple Servlet Create and compile simple servlet code 1 Start Apache Tomcat 3 Add mappings to web.xml file 2 Start Web Browser & Request Servlet 4
  • 13. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Generic Servlet A generic servlet is a protocol independent Servlet that should always override the service() method to handle the client request.. Generic Servlet is easier to write It has a very simple life cycle methods To write Generic Servlet you just need to extend javax.servlet.GenericServlet and override the service() method Pros
  • 14. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Servlet Classes & Interfaces Servlet Declares life cycle method of servlet ServletConfig Allows servlet to get Initialization methods ServletContext Enables servlet to log access and access information ServletRequest Used to read data from client request ServletResponse Used to write data to client response GenericServlet Implements servlet and Servlet.Config Interface ServletInputStream Provides input stream to read requests from the client ServletOutputStream Provides output stream to write responses to the client ServletException Indicates servlet error has occured UnavailableException Indicates servlet is not available HttpServlet Provides methods to handle Http Request and Response HttpServletRequest Enables servlets to read data from Http Request HttpServletResponse Enables servlets to write data to Http Response
  • 16. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Session Tracking in Servlets Session tracking is a way to maintain state(data) of an user 1. Request(new) 3. Second new request 2. Response Client Server
  • 17. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Cookies URL rewriting Hidden form field Http session
  • 18. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Cookies in Servlet It is a small piece of information that is persisted between the multiple client requests 1. Request 2. Request + Cookies 3. Response + Cookies
  • 19. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Useful Methods of Cookie Class public void setMaxAge(int expiry) Sets the maximum age of the cookies in seconds public String getName() Returns the name of the cookie. Name cannot be changed after creation public String getValue() Returns the value of the cookie public void setName(String name) Changes the name of the cookie public void setValue(String value) Changes the value of the cookie
  • 20. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Creating & Deleting a Cookie Deletion Creation 1.Cookie ck=new Cookie("user",“Edureka");//creating cookie object 2.response.addCookie(ck);//adding cookie in the response 1.Cookie ck=new Cookie("user","");//deleting value of cookie 2.ck.setMaxAge(0);//changing the maximum age to 0 seconds 3.response.addCookie(ck);//adding cookie in the response
  • 22. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training What is JSP? It is used to create web application just like Servlet technology. Also called as extension of servlet Fast Development Tracking User Easy to maintain Portable Powerful Flexible
  • 23. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Advantages of JSP over Servlets JSP Operation Servlets ▪ Extension to Servlet ▪ It is not a extension of JSP ▪ No need to recompile and redeploy ▪ Code needs to be recompiled ▪ Less code than servlet ▪ More code comparatively ▪ Easy to maintain ▪ Bit complicated
  • 24. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Life Cycle of JSP Buffer (dynamic content) Servlet Object JRE JSP Servlet (.java File) Class file Compiler JSP Translator
  • 26. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Steps to create JSP Page Create dynamic web project 1 Start Apache Tomcat 3 Create JSP File 2 Deploy the project and get the output 4
  • 28. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training JSP Scripting Elements <% java source code %>scriptlet <%= statement %>expression <%! field or method declaration %>declaration
  • 29. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Implicit Objects of JSP out Jspwriter request HttpServletrequest response HttpServletResponse config ServletConfig application ServletContext session HttpSession pageContent PageContext page Object exception Throwable
  • 30. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training JSP Directive Elements <%@ page directive="value” %>Page directive <%@ include file="resourceName" %>Include directive <%@ taglib uri="uriofthetaglibrary" prefix="prefixoftaglibrary" %>Taglib directive
  • 32. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Java Bean Class It is a reusable software component. A bean encapsulates many objects into one object, so we can access this object from multiple places. Moreover, it provides the easy maintenance. 1.<jsp:useBean id= "instanceName" scope= "page | request | session | application" 2.class= "packageName.className" type= "packageName.clas sName" 3.beanName="packageName.className | <%= expression >" > 4.</jsp:useBean>