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

More Related Content

What's hot (20)

PDF
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Edureka!
 
PDF
How To be a Backend developer
Ramy Hakam
 
ODP
Introduction to Web Scraping using Python and Beautiful Soup
Tushar Mittal
 
PDF
Server Side VS Client Side
Code Boxx
 
PPTX
Music Downloading Website (HTML,CSS,PHP Presentation)
Anil Kumar
 
PPTX
Presentation on Core java
mahir jain
 
PPTX
object oriented Programming ppt
Nitesh Dubey
 
PDF
What is web scraping?
Brijesh Prajapati
 
PPT
Introduction to .NET Framework
Raghuveer Guthikonda
 
PPT
Student management system project report c++
Student
 
PPTX
Complete Lecture on Css presentation
Salman Memon
 
PDF
Python Machine Learning Tutorial | Machine Learning Algorithms | Python Train...
Edureka!
 
PPTX
What Are Coroutines In Kotlin?
Simplilearn
 
PDF
Web scraping in python
Viren Rajput
 
PDF
Understanding Reactive Programming
Andres Almiray
 
PPTX
Introduction to React JS
Arnold Asllani
 
PPTX
Quiz application
Harsh Verma
 
PPT
Php mysql ppt
Karmatechnologies Pvt. Ltd.
 
PPTX
Visual Programming Lecture.pptx
Muhammadkhan704767
 
PPTX
Java Programming
Elizabeth alexander
 
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Edureka!
 
How To be a Backend developer
Ramy Hakam
 
Introduction to Web Scraping using Python and Beautiful Soup
Tushar Mittal
 
Server Side VS Client Side
Code Boxx
 
Music Downloading Website (HTML,CSS,PHP Presentation)
Anil Kumar
 
Presentation on Core java
mahir jain
 
object oriented Programming ppt
Nitesh Dubey
 
What is web scraping?
Brijesh Prajapati
 
Introduction to .NET Framework
Raghuveer Guthikonda
 
Student management system project report c++
Student
 
Complete Lecture on Css presentation
Salman Memon
 
Python Machine Learning Tutorial | Machine Learning Algorithms | Python Train...
Edureka!
 
What Are Coroutines In Kotlin?
Simplilearn
 
Web scraping in python
Viren Rajput
 
Understanding Reactive Programming
Andres Almiray
 
Introduction to React JS
Arnold Asllani
 
Quiz application
Harsh Verma
 
Visual Programming Lecture.pptx
Muhammadkhan704767
 
Java Programming
Elizabeth alexander
 

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

PDF
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Edureka!
 
PPTX
Servlets
ZainabNoorGul
 
PPTX
Servlet in java , java servlet , servlet servlet and CGI, API
PRIYADARSINISK
 
PPTX
Session 25 - Introduction to JEE, Servlets
PawanMM
 
PDF
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
PPTX
Java servlets
yuvarani p
 
PPTX
Chapter 3 servlet & jsp
Jafar Nesargi
 
PPT
Servlets
Sasidhar Kothuru
 
PDF
Lecture 2: Servlets
Fahad Golra
 
PDF
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 
PPTX
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
PDF
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
RTF
Marata
Cecille Marata
 
PPTX
java Servlet technology
Tanmoy Barman
 
PPT
Anintroductiontojavawebtechnology 090324184240-phpapp01
raviIITRoorkee
 
PPTX
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
PPT
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
PPTX
Servlets api overview
ramya marichamy
 
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Edureka!
 
Servlets
ZainabNoorGul
 
Servlet in java , java servlet , servlet servlet and CGI, API
PRIYADARSINISK
 
Session 25 - Introduction to JEE, Servlets
PawanMM
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Java servlets
yuvarani p
 
Chapter 3 servlet & jsp
Jafar Nesargi
 
Lecture 2: Servlets
Fahad Golra
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
java Servlet technology
Tanmoy Barman
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
raviIITRoorkee
 
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
Servlets api overview
ramya marichamy
 
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)

PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 

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