SlideShare a Scribd company logo
Advanced Programming
Servlets as Introduction
Gera
2020
1
Servlets
• HTML (Hyper Text Markup Language) is the tagging
language used to create Web pages.
• HTML alone can only be used to create static Web pages
⎯ pages whose content is determined at the time of
writing and which never changes.
• Though this is perfectly adequate for some applications,
an increasing number of others have a requirement for
dynamic web pages ⎯ pages whose content changes
according to the particular user or in response to
changing data.
2
Servlets…
•Some dynamic web pages common examples are
listed below.
• Results of a real-time, online survey.
• Results of a search operation.
• Contents of an electronic shopping cart.
•One powerful and increasingly popular way of
satisfying this need is to use Java servlets.
3
Servlets…
•A servlet is a program written in Java that runs on
a Web server. It is executed in response to a
client's (i.e., a browser's) HTTP request and creates
a document (usually an HTML document) to be
returned to the client by the server.
•It extends the functionality of the server, without
the performance limitations associated with CGI
programs.
4
Servlets…
•All the major Web servers now have support for
servlets.
•Servlets extend a server’s functionality by allowing
the server to generate dynamic content.
•For instance, servlets can dynamically generate
custom XHTML documents, help provide secure
access to a website, interact with databases on
behalf of a client and maintain unique session
information for each client.
5
Servlets…
•A web server component called the servlet
container executes and interacts with
servlets.
•Packages javax.servlet and javax.servlet.http
provide the classes and interfaces to define
servlets.
6
Servlets…
•The servlet container receives HTTP requests from
a client and directs each request to the
appropriate servlet.
•The servlet processes the request and returns an
appropriate response to the client — usually in the
form of an XHTML or XML (Extensible Markup
Language) document to display in the browser.
XML is a language used to exchange structured
data on the web.
7
Servlets…
• Java Servlets are programs that run on a Web or
Application server and act as a middle layer between a
requests coming from a Web browser or other HTTP
client and databases or applications on the HTTP server.
• Using Servlets, you can collect input from users through
web page forms, present records from a database or
another source, and create web pages dynamically.
• Java Servlets often serve the same purpose as programs
implemented using the Common Gateway Interface
(CGI).
8
Servlets…
But Servlets offer several advantages in comparison with the CGI.
• Performance is significantly better.
• Servlets execute within the address space of a Web server. It is not
necessary to create a separate process to handle each client
request.
• Servlets are platform-independent because they are written in Java.
• Java security manager on the server enforces a set of restrictions to
protect the resources on a server machine. So servlets are trusted.
• The full functionality of the Java class libraries is available to a
servlet. It can communicate with applets, databases, or other
software via the sockets and RMI mechanisms that you have seen
already. 9
Servlets Architecture
• The following diagram shows the position of Servlets in a
Web Application.
10
Web Browser
HTTP
Server
Servlets
Program
Database
HTTP
Protocol
Servlets Tasks
•Read the explicit data sent by the clients
(browsers). This includes an HTML form on a Web
page or it could also come from an applet or a
custom HTTP client program.
•Read the implicit HTTP request data sent by the
clients (browsers). This includes cookies, media
types and compression schemes the browser
understands, and so forth.
11
Servlets Tasks…
•Process the data and generate the results. This
process may require talking to a database,
executing an RMI or CORBA call, invoking a Web
service, or computing the response directly.
•Send the explicit data (i.e., the document) to the
clients (browsers). This document can be sent in a
variety of formats, including text (HTML or XML),
binary (GIF images), Excel, etc.
12
Servlets Tasks…
• Send the implicit HTTP response to the clients (browsers). This
includes telling the browsers or other clients what type of
document is being returned (e.g., HTML), setting cookies and
caching parameters, and other such tasks.
13
References
➢S. Horstmann and Gary Cornell, Core Java 2 – Volume II-
Advanced Features, Sun Microsystems Press
➢Harvey M. Deitel and Paul J. Deitel, Java How to
Program, Deitel & Associates
➢Tutorials Point “Java Servlets: web application
framework,” www.tutorialspoint.com
➢Jan Graba, “An Introduction to Network Programming
with Java, ” Faculty of ACES, Sheffield Hallam University,
UK, 2007.
14
Gerabirhan Paulos
ToCourseInfo@gmail.com

More Related Content

What's hot

HTTP Basic
HTTP BasicHTTP Basic
HTTP Basic
Joshua Yoon
 
HyperText Transfer Protocol
HyperText Transfer ProtocolHyperText Transfer Protocol
HyperText Transfer Protocolponduse
 
Learnadvancedjavaprogramming 131217055604-phpapp02
Learnadvancedjavaprogramming 131217055604-phpapp02Learnadvancedjavaprogramming 131217055604-phpapp02
Learnadvancedjavaprogramming 131217055604-phpapp02
Hardeep Kaur
 
HTTP Definition and Basics.
HTTP Definition and Basics.HTTP Definition and Basics.
HTTP Definition and Basics.Halah Salih
 
Le Wagon - Web 101
Le Wagon - Web 101Le Wagon - Web 101
Le Wagon - Web 101
Edward_Schults
 
Introducing asp
Introducing aspIntroducing asp
Introducing aspaspnet123
 
ITI004En-Introduction to XML (III)
ITI004En-Introduction to XML (III)ITI004En-Introduction to XML (III)
ITI004En-Introduction to XML (III)
Huibert Aalbers
 
WSDL in Mule Esb
WSDL in Mule EsbWSDL in Mule Esb
WSDL in Mule Esb
Anand kalla
 
Http and its Applications
Http and its ApplicationsHttp and its Applications
Http and its Applications
Nayan Dagliya
 
Web technology unit I - Part B
Web technology unit I - Part BWeb technology unit I - Part B
Web technology unit I - Part B
SSN College of Engineering, Kalavakkam
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer ProtocolRajan Pandey
 
HTTP fundamentals for developers
HTTP fundamentals for developersHTTP fundamentals for developers
HTTP fundamentals for developers
Mario Cardinal
 
Http
HttpHttp
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
sanjoysanyal
 
4 Basic PHP
4 Basic PHP4 Basic PHP
4 Basic PHP
Jalpesh Vasa
 
Httpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-convertedHttpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-converted
computerorganization
 
Mule batch
Mule batchMule batch
Mule batch
Gandham38
 
Hypertext transfer protocol (http)
Hypertext transfer protocol (http)Hypertext transfer protocol (http)
Hypertext transfer protocol (http)
Shimona Agarwal
 

What's hot (19)

HTTP Basic
HTTP BasicHTTP Basic
HTTP Basic
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
HyperText Transfer Protocol
HyperText Transfer ProtocolHyperText Transfer Protocol
HyperText Transfer Protocol
 
Learnadvancedjavaprogramming 131217055604-phpapp02
Learnadvancedjavaprogramming 131217055604-phpapp02Learnadvancedjavaprogramming 131217055604-phpapp02
Learnadvancedjavaprogramming 131217055604-phpapp02
 
HTTP Definition and Basics.
HTTP Definition and Basics.HTTP Definition and Basics.
HTTP Definition and Basics.
 
Le Wagon - Web 101
Le Wagon - Web 101Le Wagon - Web 101
Le Wagon - Web 101
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
 
ITI004En-Introduction to XML (III)
ITI004En-Introduction to XML (III)ITI004En-Introduction to XML (III)
ITI004En-Introduction to XML (III)
 
WSDL in Mule Esb
WSDL in Mule EsbWSDL in Mule Esb
WSDL in Mule Esb
 
Http and its Applications
Http and its ApplicationsHttp and its Applications
Http and its Applications
 
Web technology unit I - Part B
Web technology unit I - Part BWeb technology unit I - Part B
Web technology unit I - Part B
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
HTTP fundamentals for developers
HTTP fundamentals for developersHTTP fundamentals for developers
HTTP fundamentals for developers
 
Http
HttpHttp
Http
 
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 
4 Basic PHP
4 Basic PHP4 Basic PHP
4 Basic PHP
 
Httpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-convertedHttpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-converted
 
Mule batch
Mule batchMule batch
Mule batch
 
Hypertext transfer protocol (http)
Hypertext transfer protocol (http)Hypertext transfer protocol (http)
Hypertext transfer protocol (http)
 

Similar to Servlets as introduction (Advanced programming)

WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptxWEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptx
karthiksmart21
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
Mallikarjuna G D
 
Servlets api overview
Servlets api overviewServlets api overview
Servlets api overview
ramya marichamy
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
Mallikarjuna G D
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
ADEEBANADEEM
 
Webapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh guptaWebapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh gupta
Shivalik college of engineering
 
Unit 1st and 3rd notes of java
Unit 1st and 3rd notes of javaUnit 1st and 3rd notes of java
Unit 1st and 3rd notes of java
Niraj Bharambe
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
Senthil Kumar
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
SenthilKumar571813
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
MattMarino13
 
Servlet classnotes
Servlet classnotesServlet classnotes
Servlet classnotes
Vasanti Dutta
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
Web Technology Fundamentals
Web Technology FundamentalsWeb Technology Fundamentals
Web Technology Fundamentals
sunmitraeducation
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
arya krazydude
 
Ecom 1
Ecom 1Ecom 1
WEB-DBMS A quick reference
WEB-DBMS A quick referenceWEB-DBMS A quick reference
WEB-DBMS A quick referenceMarc Dy
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
Anup72
 

Similar to Servlets as introduction (Advanced programming) (20)

WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptxWEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptx
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Servlets api overview
Servlets api overviewServlets api overview
Servlets api overview
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
Webapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh guptaWebapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh gupta
 
Unit 1st and 3rd notes of java
Unit 1st and 3rd notes of javaUnit 1st and 3rd notes of java
Unit 1st and 3rd notes of java
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
 
Servlet classnotes
Servlet classnotesServlet classnotes
Servlet classnotes
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
 
Web Technology Fundamentals
Web Technology FundamentalsWeb Technology Fundamentals
Web Technology Fundamentals
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
Java part 3
Java part  3Java part  3
Java part 3
 
Server side scripting
Server side scriptingServer side scripting
Server side scripting
 
WEB-DBMS A quick reference
WEB-DBMS A quick referenceWEB-DBMS A quick reference
WEB-DBMS A quick reference
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
 

More from Gera Paulos

Networking in java, Advanced programming
Networking in java, Advanced programmingNetworking in java, Advanced programming
Networking in java, Advanced programming
Gera Paulos
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
Gera Paulos
 
Multi Threading Concept (Advanced programming)
Multi Threading Concept (Advanced programming)Multi Threading Concept (Advanced programming)
Multi Threading Concept (Advanced programming)
Gera Paulos
 
Java Database Connectivity (Advanced programming)
Java Database Connectivity (Advanced programming)Java Database Connectivity (Advanced programming)
Java Database Connectivity (Advanced programming)
Gera Paulos
 
Advanced programming ch1
Advanced programming ch1Advanced programming ch1
Advanced programming ch1
Gera Paulos
 
Image restoration and enhancement #2
Image restoration and enhancement #2 Image restoration and enhancement #2
Image restoration and enhancement #2
Gera Paulos
 
Introduction to digital image processing #1
Introduction to digital image processing #1Introduction to digital image processing #1
Introduction to digital image processing #1
Gera Paulos
 
Implement maintenance procedures
Implement maintenance proceduresImplement maintenance procedures
Implement maintenance procedures
Gera Paulos
 
Maintain equipment and consumables
Maintain equipment and consumablesMaintain equipment and consumables
Maintain equipment and consumables
Gera Paulos
 
Care for network and computer hardware
Care for network and computer hardwareCare for network and computer hardware
Care for network and computer hardware
Gera Paulos
 
Update and document operational procedures
Update and document operational proceduresUpdate and document operational procedures
Update and document operational procedures
Gera Paulos
 
Apply quality control
Apply quality controlApply quality control
Apply quality control
Gera Paulos
 
Monitoring implementation of work plan
Monitoring implementation of work planMonitoring implementation of work plan
Monitoring implementation of work plan
Gera Paulos
 
Provide first level remote help desk support
Provide first level remote help desk supportProvide first level remote help desk support
Provide first level remote help desk support
Gera Paulos
 
Configuring and administrate server
Configuring and administrate serverConfiguring and administrate server
Configuring and administrate server
Gera Paulos
 
Identifying and resolving network problems
Identifying and resolving network problemsIdentifying and resolving network problems
Identifying and resolving network problems
Gera Paulos
 
Conduct / facilitate user training
Conduct / facilitate user trainingConduct / facilitate user training
Conduct / facilitate user training
Gera Paulos
 
Monitor and administer system and network
Monitor and administer system and network Monitor and administer system and network
Monitor and administer system and network
Gera Paulos
 
Creating technical documents
Creating technical documentsCreating technical documents
Creating technical documents
Gera Paulos
 
Determine bestfit topology lecture #2 edit
Determine bestfit topology lecture #2 editDetermine bestfit topology lecture #2 edit
Determine bestfit topology lecture #2 edit
Gera Paulos
 

More from Gera Paulos (20)

Networking in java, Advanced programming
Networking in java, Advanced programmingNetworking in java, Advanced programming
Networking in java, Advanced programming
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
Multi Threading Concept (Advanced programming)
Multi Threading Concept (Advanced programming)Multi Threading Concept (Advanced programming)
Multi Threading Concept (Advanced programming)
 
Java Database Connectivity (Advanced programming)
Java Database Connectivity (Advanced programming)Java Database Connectivity (Advanced programming)
Java Database Connectivity (Advanced programming)
 
Advanced programming ch1
Advanced programming ch1Advanced programming ch1
Advanced programming ch1
 
Image restoration and enhancement #2
Image restoration and enhancement #2 Image restoration and enhancement #2
Image restoration and enhancement #2
 
Introduction to digital image processing #1
Introduction to digital image processing #1Introduction to digital image processing #1
Introduction to digital image processing #1
 
Implement maintenance procedures
Implement maintenance proceduresImplement maintenance procedures
Implement maintenance procedures
 
Maintain equipment and consumables
Maintain equipment and consumablesMaintain equipment and consumables
Maintain equipment and consumables
 
Care for network and computer hardware
Care for network and computer hardwareCare for network and computer hardware
Care for network and computer hardware
 
Update and document operational procedures
Update and document operational proceduresUpdate and document operational procedures
Update and document operational procedures
 
Apply quality control
Apply quality controlApply quality control
Apply quality control
 
Monitoring implementation of work plan
Monitoring implementation of work planMonitoring implementation of work plan
Monitoring implementation of work plan
 
Provide first level remote help desk support
Provide first level remote help desk supportProvide first level remote help desk support
Provide first level remote help desk support
 
Configuring and administrate server
Configuring and administrate serverConfiguring and administrate server
Configuring and administrate server
 
Identifying and resolving network problems
Identifying and resolving network problemsIdentifying and resolving network problems
Identifying and resolving network problems
 
Conduct / facilitate user training
Conduct / facilitate user trainingConduct / facilitate user training
Conduct / facilitate user training
 
Monitor and administer system and network
Monitor and administer system and network Monitor and administer system and network
Monitor and administer system and network
 
Creating technical documents
Creating technical documentsCreating technical documents
Creating technical documents
 
Determine bestfit topology lecture #2 edit
Determine bestfit topology lecture #2 editDetermine bestfit topology lecture #2 edit
Determine bestfit topology lecture #2 edit
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 

Servlets as introduction (Advanced programming)

  • 1. Advanced Programming Servlets as Introduction Gera 2020 1
  • 2. Servlets • HTML (Hyper Text Markup Language) is the tagging language used to create Web pages. • HTML alone can only be used to create static Web pages ⎯ pages whose content is determined at the time of writing and which never changes. • Though this is perfectly adequate for some applications, an increasing number of others have a requirement for dynamic web pages ⎯ pages whose content changes according to the particular user or in response to changing data. 2
  • 3. Servlets… •Some dynamic web pages common examples are listed below. • Results of a real-time, online survey. • Results of a search operation. • Contents of an electronic shopping cart. •One powerful and increasingly popular way of satisfying this need is to use Java servlets. 3
  • 4. Servlets… •A servlet is a program written in Java that runs on a Web server. It is executed in response to a client's (i.e., a browser's) HTTP request and creates a document (usually an HTML document) to be returned to the client by the server. •It extends the functionality of the server, without the performance limitations associated with CGI programs. 4
  • 5. Servlets… •All the major Web servers now have support for servlets. •Servlets extend a server’s functionality by allowing the server to generate dynamic content. •For instance, servlets can dynamically generate custom XHTML documents, help provide secure access to a website, interact with databases on behalf of a client and maintain unique session information for each client. 5
  • 6. Servlets… •A web server component called the servlet container executes and interacts with servlets. •Packages javax.servlet and javax.servlet.http provide the classes and interfaces to define servlets. 6
  • 7. Servlets… •The servlet container receives HTTP requests from a client and directs each request to the appropriate servlet. •The servlet processes the request and returns an appropriate response to the client — usually in the form of an XHTML or XML (Extensible Markup Language) document to display in the browser. XML is a language used to exchange structured data on the web. 7
  • 8. Servlets… • Java Servlets are programs that run on a Web or Application server and act as a middle layer between a requests coming from a Web browser or other HTTP client and databases or applications on the HTTP server. • Using Servlets, you can collect input from users through web page forms, present records from a database or another source, and create web pages dynamically. • Java Servlets often serve the same purpose as programs implemented using the Common Gateway Interface (CGI). 8
  • 9. Servlets… But Servlets offer several advantages in comparison with the CGI. • Performance is significantly better. • Servlets execute within the address space of a Web server. It is not necessary to create a separate process to handle each client request. • Servlets are platform-independent because they are written in Java. • Java security manager on the server enforces a set of restrictions to protect the resources on a server machine. So servlets are trusted. • The full functionality of the Java class libraries is available to a servlet. It can communicate with applets, databases, or other software via the sockets and RMI mechanisms that you have seen already. 9
  • 10. Servlets Architecture • The following diagram shows the position of Servlets in a Web Application. 10 Web Browser HTTP Server Servlets Program Database HTTP Protocol
  • 11. Servlets Tasks •Read the explicit data sent by the clients (browsers). This includes an HTML form on a Web page or it could also come from an applet or a custom HTTP client program. •Read the implicit HTTP request data sent by the clients (browsers). This includes cookies, media types and compression schemes the browser understands, and so forth. 11
  • 12. Servlets Tasks… •Process the data and generate the results. This process may require talking to a database, executing an RMI or CORBA call, invoking a Web service, or computing the response directly. •Send the explicit data (i.e., the document) to the clients (browsers). This document can be sent in a variety of formats, including text (HTML or XML), binary (GIF images), Excel, etc. 12
  • 13. Servlets Tasks… • Send the implicit HTTP response to the clients (browsers). This includes telling the browsers or other clients what type of document is being returned (e.g., HTML), setting cookies and caching parameters, and other such tasks. 13
  • 14. References ➢S. Horstmann and Gary Cornell, Core Java 2 – Volume II- Advanced Features, Sun Microsystems Press ➢Harvey M. Deitel and Paul J. Deitel, Java How to Program, Deitel & Associates ➢Tutorials Point “Java Servlets: web application framework,” www.tutorialspoint.com ➢Jan Graba, “An Introduction to Network Programming with Java, ” Faculty of ACES, Sheffield Hallam University, UK, 2007. 14 Gerabirhan Paulos ToCourseInfo@gmail.com