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
Introduction to WEB
WEB & HTTP
HTTP Request & Response
What are Servlets?
Servlet Classes & Interfaces
Servlet Architecture
Generic Servlets
Servlet Request & Response
CGI vs Servlets
Introduction to
WEB
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Introduction to Web
Request
Response is sent to client
Client Server
Web is basically a system of Internet servers that support specially formatted documents
WEB & HTTP
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
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Difference between HTTP Get & Post
HTTP GET
Operation
HTTP POST
▪ Data is sent in header ▪ Data is sent in request body
▪ Not secured ▪ It is secured
▪ Can be bookmarked ▪ Cannot be bookmarked
▪ Limited data can be sent ▪ Large amount of data can be sent
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
CGI VS Servlets
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
What is CGI?
Common Gateway Interface (CGI) is a standard for writing programs that can interact through a Web
server with a client running a Web browser.
High Response Time Low Response Time
Not Secure Secure
Not Scalable Highly Scalable
CGI
VS
SERVLET
Servlet
Architecture
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Servlet Architecture
Web Browser
DatabaseServlet ProgramHTTP Server
HTTP Protocol
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
Request & Response
Servlet Request
Servlet Response
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Request & Response
Servlet Response
Servlet Request
An object of ServletRequest is used to provide the client request
information to a servlet such as content type, content length,
parameter names and values, header informations, attributes etc.
JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training
Request & Response
Servlet Response
Servlet Request
An object of ServletResponse is used to write the information back
to the client.
Servlet Classes
& Interface
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
Java Servlets Tutorial | Introduction to Servlets | Java Certification Training | Edureka
Ad

Recommended

Spring boot - an introduction
Spring boot - an introduction
Jonathan Holloway
 
Spring Boot Tutorial
Spring Boot Tutorial
Naphachara Rattanawilai
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
 
Spring ppt
Spring ppt
Mumbai Academisc
 
REST API
REST API
Tofazzal Ahmed
 
Web Development on Web Project Presentation
Web Development on Web Project Presentation
Milind Gokhale
 
Integrating Servlets and JSP (The MVC Architecture)
Integrating Servlets and JSP (The MVC Architecture)
Amit Ranjan
 
Apache web server
Apache web server
Rishabh Bahukhandi
 
REST API Design & Development
REST API Design & Development
Ashok Pundit
 
Spring Boot
Spring Boot
Pei-Tang Huang
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample application
Antoine Rey
 
JVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdf
Bartłomiej Żyliński
 
Spring boot introduction
Spring boot introduction
Rasheed Waraich
 
Introduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
 
Spring Boot
Spring Boot
koppenolski
 
Spring Boot in Action
Spring Boot in Action
Alex Movila
 
Loops in JavaScript
Loops in JavaScript
Florence Davis
 
Introduction to thymeleaf
Introduction to thymeleaf
NexThoughts Technologies
 
Rest api-basic
Rest api-basic
Amila Sampath
 
Express JS Rest API Tutorial
Express JS Rest API Tutorial
Simplilearn
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
Bertrand Delacretaz
 
How to Convert a Component Design into an MUI React Code
How to Convert a Component Design into an MUI React Code
WrapPixel
 
Spring Boot
Spring Boot
Jiayun Zhou
 
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Michel Schudel
 
Intro to Reactive Programming
Intro to Reactive Programming
Stéphane Maldini
 
Jsp presentation
Jsp presentation
Lakshmi R
 
API - Interface de Programação de Aplicativos
API - Interface de Programação de Aplicativos
Felipe J. R. Vieira
 
Spring Boot
Spring Boot
Jaran Flaath
 
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Edureka!
 
Servlets
Servlets
ZainabNoorGul
 

More Related Content

What's hot (20)

REST API Design & Development
REST API Design & Development
Ashok Pundit
 
Spring Boot
Spring Boot
Pei-Tang Huang
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample application
Antoine Rey
 
JVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdf
Bartłomiej Żyliński
 
Spring boot introduction
Spring boot introduction
Rasheed Waraich
 
Introduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
 
Spring Boot
Spring Boot
koppenolski
 
Spring Boot in Action
Spring Boot in Action
Alex Movila
 
Loops in JavaScript
Loops in JavaScript
Florence Davis
 
Introduction to thymeleaf
Introduction to thymeleaf
NexThoughts Technologies
 
Rest api-basic
Rest api-basic
Amila Sampath
 
Express JS Rest API Tutorial
Express JS Rest API Tutorial
Simplilearn
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
Bertrand Delacretaz
 
How to Convert a Component Design into an MUI React Code
How to Convert a Component Design into an MUI React Code
WrapPixel
 
Spring Boot
Spring Boot
Jiayun Zhou
 
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Michel Schudel
 
Intro to Reactive Programming
Intro to Reactive Programming
Stéphane Maldini
 
Jsp presentation
Jsp presentation
Lakshmi R
 
API - Interface de Programação de Aplicativos
API - Interface de Programação de Aplicativos
Felipe J. R. Vieira
 
Spring Boot
Spring Boot
Jaran Flaath
 
REST API Design & Development
REST API Design & Development
Ashok Pundit
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample application
Antoine Rey
 
Spring boot introduction
Spring boot introduction
Rasheed Waraich
 
Spring Boot in Action
Spring Boot in Action
Alex Movila
 
Express JS Rest API Tutorial
Express JS Rest API Tutorial
Simplilearn
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
Bertrand Delacretaz
 
How to Convert a Component Design into an MUI React Code
How to Convert a Component Design into an MUI React Code
WrapPixel
 
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition!
Michel Schudel
 
Intro to Reactive Programming
Intro to Reactive Programming
Stéphane Maldini
 
Jsp presentation
Jsp presentation
Lakshmi R
 
API - Interface de Programação de Aplicativos
API - Interface de Programação de Aplicativos
Felipe J. R. Vieira
 

Similar to Java Servlets Tutorial | Introduction to Servlets | Java Certification Training | Edureka (20)

Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Edureka!
 
Servlets
Servlets
ZainabNoorGul
 
Servlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, API
PRIYADARSINISK
 
Session 25 - Introduction to JEE, Servlets
Session 25 - Introduction to JEE, Servlets
PawanMM
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Java servlets
Java servlets
yuvarani p
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
Servlets
Servlets
Sasidhar Kothuru
 
Servlet by Rj
Servlet by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Lecture 2: Servlets
Lecture 2: Servlets
Fahad Golra
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 
WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
Marata
Marata
Cecille Marata
 
java Servlet technology
java Servlet technology
Tanmoy Barman
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01
raviIITRoorkee
 
UNIT - 5.pptx Servlets And Database Connectivity
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
Servlets api overview
Servlets api overview
ramya marichamy
 
WEB TECHNOLOGIES Servlet
WEB TECHNOLOGIES Servlet
Jyothishmathi Institute of Technology and Science Karimnagar
 
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Edureka!
 
Servlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, API
PRIYADARSINISK
 
Session 25 - Introduction to JEE, Servlets
Session 25 - Introduction to JEE, Servlets
PawanMM
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
Lecture 2: Servlets
Lecture 2: Servlets
Fahad Golra
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 
WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
java Servlet technology
java Servlet technology
Tanmoy Barman
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01
raviIITRoorkee
 
UNIT - 5.pptx Servlets And Database Connectivity
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
Ad

More from Edureka! (20)

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

Recently uploaded (20)

The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 

Java Servlets Tutorial | Introduction to Servlets | 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 Introduction to WEB WEB & HTTP HTTP Request & Response What are Servlets? Servlet Classes & Interfaces Servlet Architecture Generic Servlets Servlet Request & Response CGI vs Servlets
  • 4. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Introduction to Web Request Response is sent to client Client Server Web is basically a system of Internet servers that support specially formatted documents
  • 6. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Web & HTTP
  • 7. 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.
  • 8. 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
  • 9. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Difference between HTTP Get & Post HTTP GET Operation HTTP POST ▪ Data is sent in header ▪ Data is sent in request body ▪ Not secured ▪ It is secured ▪ Can be bookmarked ▪ Cannot be bookmarked ▪ Limited data can be sent ▪ Large amount of data can be sent
  • 11. 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
  • 12. 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
  • 14. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training What is CGI? Common Gateway Interface (CGI) is a standard for writing programs that can interact through a Web server with a client running a Web browser. High Response Time Low Response Time Not Secure Secure Not Scalable Highly Scalable CGI VS SERVLET
  • 16. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Servlet Architecture Web Browser DatabaseServlet ProgramHTTP Server HTTP Protocol
  • 17. 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
  • 18. 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
  • 20. 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
  • 21. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Request & Response Servlet Request Servlet Response
  • 22. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Request & Response Servlet Response Servlet Request An object of ServletRequest is used to provide the client request information to a servlet such as content type, content length, parameter names and values, header informations, attributes etc.
  • 23. JAVA CERTIFICATION TRAINING www.edureka.co/java-j2ee-soa-training Request & Response Servlet Response Servlet Request An object of ServletResponse is used to write the information back to the client.
  • 25. 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