SlideShare a Scribd company logo
Servlets Overview
Agenda
• Introduction to Java Servlets
• Servlet Life Cycle
• Describe web applications, CGI, and the role of Java
• Describe benefits of Java servlet technology
• Create a simple Java Servlet
Introduction to Java Servlets
• Read explicit data sent by client (form data)
• Read implicit data sent by client
(request headers)
• Generate the results
• Send the explicit data back to client (HTML)
• Send the implicit data to client
(status codes and response headers)
Servlets Overview(cont.)
Servlets LifeCycle
• A servlet passes through the following stages in its life.
- Initialize
- Service
- Destroy
Servlet’s Life Cycle (Cont)
Characteristic of Init() stage
• Executed once, when the servlet gets loaded for the first time
• Not called for each client request
• The above two points make it an ideal place to perform the
startup tasks which are done in constructor in a normal class.
Characteristic of service() stage
• service() method is the engine of the servlet
• It is executed per request in a separate Thread
• Hence faster and efficient than CGI
• It is an important method to be overridden in GenericServlet
Benefits of Servlets
• Efficient
- Servlets are light weight java threads and not a process like CGI
- For each request there would be a n no of threads for n
no of requests but only a single Object of a Servlet
class
- When CGI finishes handling request the program terminates making
difficult to cache computations ,keep connection open etc
- Servlets remain in the memory even after the response is complete.
Benefits of Servlets
• Convenient
- Servlets have an extensive infrastructure for
• Parsing and decoding
• Reading and setting http headers
• Handling cookies
• Tracking sessions
- In CGI we have to depend on Perl for such tasks
Benefits of Servlets
• Powerful
- Servlets support several capabilities like
• Communicating with Web Server
• Translate relative URL’s to concrete Path
• Sharing data
• Connection Pooling and optimization
- In CGI we have to user server specific API
Benefits of Servlets
• Portability
- Servlets are written in java and can be deployed in Multiple Servers
• Secure
- Being written entirely in java.
- Does not rely on O/S shell as CGI
Summary
• Demonstrate a simple Servlet example
• Overview the Life cycle of a servlet
• Benefits of Servlet compared to CGI
Ad

More Related Content

What's hot (20)

Java architecture for xml binding
Java architecture for xml bindingJava architecture for xml binding
Java architecture for xml binding
Kiran Gajbhiye
 
Express yourself
Express yourselfExpress yourself
Express yourself
Yaniv Rodenski
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web Scripts
Piergiorgio Lucidi
 
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European BankAlfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Piergiorgio Lucidi
 
Node ts1
Node ts1Node ts1
Node ts1
Yaniv Rodenski
 
Signal rity1
Signal rity1Signal rity1
Signal rity1
Yaniv Rodenski
 
Implementing advanced integration patterns with WSO2 ESB
Implementing advanced integration patterns with WSO2 ESBImplementing advanced integration patterns with WSO2 ESB
Implementing advanced integration patterns with WSO2 ESB
WSO2
 
Log management system for Microservices
Log management system for MicroservicesLog management system for Microservices
Log management system for Microservices
Võ Duy Tuấn
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCF
Piergiorgio Lucidi
 
AngularJS
AngularJSAngularJS
AngularJS
Yogesh L
 
Introduction to JCA and MDB
Introduction to JCA and MDBIntroduction to JCA and MDB
Introduction to JCA and MDB
Kenji HASUNUMA
 
Rest assured
Rest assuredRest assured
Rest assured
Yaniv Rodenski
 
ASP.NET MVC overview
ASP.NET MVC overviewASP.NET MVC overview
ASP.NET MVC overview
Vladislav Hadzhiyski
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
mbaric
 
MongoDB and MongoMK Source Event
MongoDB and MongoMK Source EventMongoDB and MongoMK Source Event
MongoDB and MongoMK Source Event
Yuval Ararat
 
Web forms Overview Presentation
Web forms Overview PresentationWeb forms Overview Presentation
Web forms Overview Presentation
Vladislav Hadzhiyski
 
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and CompositionWSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2
 
Mule ESB Intro
Mule ESB IntroMule ESB Intro
Mule ESB Intro
Noga Manela
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构
Benjamin Tan
 
WSO2-ESB - The backbone of Enterprise Integration
WSO2-ESB - The backbone of Enterprise IntegrationWSO2-ESB - The backbone of Enterprise Integration
WSO2-ESB - The backbone of Enterprise Integration
Kasun Indrasiri
 
Java architecture for xml binding
Java architecture for xml bindingJava architecture for xml binding
Java architecture for xml binding
Kiran Gajbhiye
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web Scripts
Piergiorgio Lucidi
 
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European BankAlfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Piergiorgio Lucidi
 
Implementing advanced integration patterns with WSO2 ESB
Implementing advanced integration patterns with WSO2 ESBImplementing advanced integration patterns with WSO2 ESB
Implementing advanced integration patterns with WSO2 ESB
WSO2
 
Log management system for Microservices
Log management system for MicroservicesLog management system for Microservices
Log management system for Microservices
Võ Duy Tuấn
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCF
Piergiorgio Lucidi
 
Introduction to JCA and MDB
Introduction to JCA and MDBIntroduction to JCA and MDB
Introduction to JCA and MDB
Kenji HASUNUMA
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
mbaric
 
MongoDB and MongoMK Source Event
MongoDB and MongoMK Source EventMongoDB and MongoMK Source Event
MongoDB and MongoMK Source Event
Yuval Ararat
 
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and CompositionWSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构
Benjamin Tan
 
WSO2-ESB - The backbone of Enterprise Integration
WSO2-ESB - The backbone of Enterprise IntegrationWSO2-ESB - The backbone of Enterprise Integration
WSO2-ESB - The backbone of Enterprise Integration
Kasun Indrasiri
 

Similar to Advance java session 2 (20)

Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsi krishna
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsitricks
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsitricks
 
UNIT - 5.pptx Servlets And Database Connectivity
UNIT - 5.pptx  Servlets And Database ConnectivityUNIT - 5.pptx  Servlets And Database Connectivity
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database ConnectivityIT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
Wt unit 3 server side technology
Wt unit 3 server side technologyWt unit 3 server side technology
Wt unit 3 server side technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
Wt unit 3 server side technology
Wt unit 3 server side technologyWt unit 3 server side technology
Wt unit 3 server side technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptxWEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
ADEEBANADEEM
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
VMahesh5
 
21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students
21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students
21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students
VENKATESHBHAT25
 
Lecture 2: Servlets
Lecture 2:  ServletsLecture 2:  Servlets
Lecture 2: Servlets
Fahad Golra
 
presentation on online movie ticket booking
presentation on online movie ticket bookingpresentation on online movie ticket booking
presentation on online movie ticket booking
dharmawath
 
Module 4.pptModule 4.pptModule 4.pptModule 4.ppt
Module 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.ppt
Module 4.pptModule 4.pptModule 4.pptModule 4.ppt
tahirnaquash2
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
Gary Yeh
 
Servlets
ServletsServlets
Servlets
Sasidhar Kothuru
 
Advance java1.1
Advance java1.1Advance java1.1
Advance java1.1
Prince Soni
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
SenthilKumar571813
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
Senthil Kumar
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsi krishna
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsitricks
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsitricks
 
UNIT - 5.pptx Servlets And Database Connectivity
UNIT - 5.pptx  Servlets And Database ConnectivityUNIT - 5.pptx  Servlets And Database Connectivity
UNIT - 5.pptx Servlets And Database Connectivity
bmit1
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database ConnectivityIT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
pkaviya
 
WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptxWEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
ADEEBANADEEM
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
VMahesh5
 
21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students
21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students
21CS642 Module 4_1 Servlets PPT.pptx VI SEM CSE Students
VENKATESHBHAT25
 
Lecture 2: Servlets
Lecture 2:  ServletsLecture 2:  Servlets
Lecture 2: Servlets
Fahad Golra
 
presentation on online movie ticket booking
presentation on online movie ticket bookingpresentation on online movie ticket booking
presentation on online movie ticket booking
dharmawath
 
Module 4.pptModule 4.pptModule 4.pptModule 4.ppt
Module 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.pptModule 4.ppt
Module 4.pptModule 4.pptModule 4.pptModule 4.ppt
tahirnaquash2
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
Gary Yeh
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
Ad

More from Smita B Kumar (18)

Advance java session 19
Advance java session 19Advance java session 19
Advance java session 19
Smita B Kumar
 
Advance java session 18
Advance java session 18Advance java session 18
Advance java session 18
Smita B Kumar
 
Advance java session 17
Advance java session 17Advance java session 17
Advance java session 17
Smita B Kumar
 
Advance java session 16
Advance java session 16Advance java session 16
Advance java session 16
Smita B Kumar
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15
Smita B Kumar
 
Advance java session 14
Advance java session 14Advance java session 14
Advance java session 14
Smita B Kumar
 
Advance java session 13
Advance java session 13Advance java session 13
Advance java session 13
Smita B Kumar
 
Advance java session 12
Advance java session 12Advance java session 12
Advance java session 12
Smita B Kumar
 
Advance java session 11
Advance java session 11Advance java session 11
Advance java session 11
Smita B Kumar
 
Advance java session 10
Advance java session 10Advance java session 10
Advance java session 10
Smita B Kumar
 
Advance java session 9
Advance java session 9Advance java session 9
Advance java session 9
Smita B Kumar
 
Advance java session 8
Advance java session 8Advance java session 8
Advance java session 8
Smita B Kumar
 
Advance java session 7
Advance java session 7Advance java session 7
Advance java session 7
Smita B Kumar
 
Advance java session 6
Advance java session 6Advance java session 6
Advance java session 6
Smita B Kumar
 
Advance java session 5
Advance java session 5Advance java session 5
Advance java session 5
Smita B Kumar
 
Advance java session 4
Advance java session 4Advance java session 4
Advance java session 4
Smita B Kumar
 
Advance java session 3
Advance java session 3Advance java session 3
Advance java session 3
Smita B Kumar
 
01 introduction to struts2
01 introduction to struts201 introduction to struts2
01 introduction to struts2
Smita B Kumar
 
Advance java session 19
Advance java session 19Advance java session 19
Advance java session 19
Smita B Kumar
 
Advance java session 18
Advance java session 18Advance java session 18
Advance java session 18
Smita B Kumar
 
Advance java session 17
Advance java session 17Advance java session 17
Advance java session 17
Smita B Kumar
 
Advance java session 16
Advance java session 16Advance java session 16
Advance java session 16
Smita B Kumar
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15
Smita B Kumar
 
Advance java session 14
Advance java session 14Advance java session 14
Advance java session 14
Smita B Kumar
 
Advance java session 13
Advance java session 13Advance java session 13
Advance java session 13
Smita B Kumar
 
Advance java session 12
Advance java session 12Advance java session 12
Advance java session 12
Smita B Kumar
 
Advance java session 11
Advance java session 11Advance java session 11
Advance java session 11
Smita B Kumar
 
Advance java session 10
Advance java session 10Advance java session 10
Advance java session 10
Smita B Kumar
 
Advance java session 9
Advance java session 9Advance java session 9
Advance java session 9
Smita B Kumar
 
Advance java session 8
Advance java session 8Advance java session 8
Advance java session 8
Smita B Kumar
 
Advance java session 7
Advance java session 7Advance java session 7
Advance java session 7
Smita B Kumar
 
Advance java session 6
Advance java session 6Advance java session 6
Advance java session 6
Smita B Kumar
 
Advance java session 5
Advance java session 5Advance java session 5
Advance java session 5
Smita B Kumar
 
Advance java session 4
Advance java session 4Advance java session 4
Advance java session 4
Smita B Kumar
 
Advance java session 3
Advance java session 3Advance java session 3
Advance java session 3
Smita B Kumar
 
01 introduction to struts2
01 introduction to struts201 introduction to struts2
01 introduction to struts2
Smita B Kumar
 
Ad

Recently uploaded (20)

Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 

Advance java session 2

  • 2. Agenda • Introduction to Java Servlets • Servlet Life Cycle • Describe web applications, CGI, and the role of Java • Describe benefits of Java servlet technology • Create a simple Java Servlet
  • 3. Introduction to Java Servlets • Read explicit data sent by client (form data) • Read implicit data sent by client (request headers) • Generate the results • Send the explicit data back to client (HTML) • Send the implicit data to client (status codes and response headers)
  • 5. Servlets LifeCycle • A servlet passes through the following stages in its life. - Initialize - Service - Destroy
  • 7. Characteristic of Init() stage • Executed once, when the servlet gets loaded for the first time • Not called for each client request • The above two points make it an ideal place to perform the startup tasks which are done in constructor in a normal class.
  • 8. Characteristic of service() stage • service() method is the engine of the servlet • It is executed per request in a separate Thread • Hence faster and efficient than CGI • It is an important method to be overridden in GenericServlet
  • 9. Benefits of Servlets • Efficient - Servlets are light weight java threads and not a process like CGI - For each request there would be a n no of threads for n no of requests but only a single Object of a Servlet class - When CGI finishes handling request the program terminates making difficult to cache computations ,keep connection open etc - Servlets remain in the memory even after the response is complete.
  • 10. Benefits of Servlets • Convenient - Servlets have an extensive infrastructure for • Parsing and decoding • Reading and setting http headers • Handling cookies • Tracking sessions - In CGI we have to depend on Perl for such tasks
  • 11. Benefits of Servlets • Powerful - Servlets support several capabilities like • Communicating with Web Server • Translate relative URL’s to concrete Path • Sharing data • Connection Pooling and optimization - In CGI we have to user server specific API
  • 12. Benefits of Servlets • Portability - Servlets are written in java and can be deployed in Multiple Servers • Secure - Being written entirely in java. - Does not rely on O/S shell as CGI
  • 13. Summary • Demonstrate a simple Servlet example • Overview the Life cycle of a servlet • Benefits of Servlet compared to CGI