SlideShare a Scribd company logo
1 of 15
SERVLETS API OVERVIEW
PRESENTED BY
M.RAMYA
M.sc (CS & IT)
NADAR SARASWATHI COLLEGE OF ARTS &
SCIENCE,
THENI.
SERVLETS
• Servlets used to create web application
• Servlets are middle layer of between a request from browser or
HTTP client and database application.
• Servlets are robust and scalable
• Servlets are platform independent
• Servlets resides at server side and generates dynamic web page
• Servlets are used to collect input through the web forms or to
show records from database via web reports.
• Servlets performance is significantly better than CGI.
• Servlets execute within the address space of a Web server. So
it is not necessary to create a separate process to handle each
client request.
• Servlets are secure.
SERVLETS – DIAGRAMMATIC REPRESENTATION
Web browser HTTP Server
Servlet Program
Database
SERVLETS EXECUTION STEPS :
• Browser or any HTTP client sent data to the HTTP Server in the form of Web Page.
• The request sent by the Browser or client is read by Servlets. Request or data sent
includes
• Servlet then processes the data and generate the results.
• Servlet then Sends data to the clients (browsers) in verity of formats which
includes web page, Images, pdf or excel
No. Request Sent by Browser includes
1 HTML Form
2 cookies
3 media types
4 compression schemes etc
DIFFERENT TERMS USED IN SERVLET
TECHNOLOGY :
Term Description
HTTP Protocol
allows web servers and browsers to
exchange data over the web
Get and Post method
Methods for a request-response data
between a client and server
Container
Run time environment for Java EE
applications
Application Server
A server that exposes business logic to
client applications through various
protocols including HTTP.
Web Server A server that handles HTTP protocol.
Content Type
HTTP header which provides the
description about what are you sending to
the browser.
Deployment
Activity by which make a web application
available for use
SERVLET API
• Before creating the first servlets, you need to understand the
Servlet API and Tomcat Servlet container. The Servlet API
provides interfaces and classes that are required to built
servlets. These interfaces and classes are group into the
following two packages :
• javax.servlet
• javax.servlet. Http
JAVAX.SERVLET PACKAGE
• The javax.Servlet package contains a number of interfaces and
classes that establish the framework in which servlets operate.
The classes and interface in this package are protocol
independent. The Fig. shows classes and interfaces in this
package.
The javax.servlet package contains many interfaces and
classes. Some of the interfaces and classes are listed in table.
Interfaces Description
Servlet Declares life cycle methods that all
servlets must implement.
ServletConfig Allows servlets to get initialization
parameters
ServletContext Allows servlets to communicate
with its servlet container.
ServletRequest Provides client request information
to a servlet.
ServletResponse Assist a servlet in sending a
response to the client.
Classes Description
GenericServlet Provides a basic implementation of the
Servlet interface for protocol
independent servlets
ServletlnputStream Provides an input stream for reading
binary data from a client request.
ServletOutputStream Provides an output stream for sending
binary data to the client.
ServletException Defines a general exception, a servlet
can throw when it encounters
difficulty.
UnavailableException Indicates that a servlet is not available
to service client request.
WRITING SERVLETS
• Servlet is an extension to a server that enhances the server's
functionality. The most common use for a servlet is to extend a
web server by providing dynamic web content
• . Web servers display documents written in HyperText Markup
Language (HTML) and respond to user requests using the
HyperText Transfer Protocol (HTTP).
• HTTP is the protocol for moving hypertext files across the
internet. HTML documents contain text that has been marked
up for interpretation by an HTML browser such as Netscape.
SIMPLE SERVLETS HANDLING HTML
• Handling form data represented in HTML page is a very
common task in web development. A typical scenario is the
user fills in fields of a form and submits it.
• The server will process the request based on the submitted
data, and send response back to the client.
• To create a form in HTML we need to use the following tags:
– <form>: to create a form to add fields in its body.
– <input>, <select>, <text area>…: to create form fields like
text boxes, dropdown list, text area, check boxes, radio
buttons,… and submit button.
Servlets api overview

More Related Content

What's hot (20)

Servlets
ServletsServlets
Servlets
 
servlet in java
servlet in javaservlet in java
servlet in java
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Java socket programming
Java socket programmingJava socket programming
Java socket programming
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Advance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.ServletAdvance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.Servlet
 
Servlet life cycle
Servlet life cycleServlet life cycle
Servlet life cycle
 
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Java Servlet
Java ServletJava Servlet
Java Servlet
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentals
 
Layout manager
Layout managerLayout manager
Layout manager
 
Jsp element
Jsp elementJsp element
Jsp element
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technology
 
GRID VIEW PPT
GRID VIEW PPTGRID VIEW PPT
GRID VIEW PPT
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 

Similar to Servlets api overview

WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptxWEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptxkarthiksmart21
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music storeADEEBANADEEM
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteTushar B Kute
 
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 Connectivitypkaviya
 
Servlets as introduction (Advanced programming)
Servlets as introduction (Advanced programming)Servlets as introduction (Advanced programming)
Servlets as introduction (Advanced programming)Gera Paulos
 
Servlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, APIServlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, APIPRIYADARSINISK
 
UNIT-3 Servlet
UNIT-3 ServletUNIT-3 Servlet
UNIT-3 Servletssbd6985
 
Liit tyit sem 5 enterprise java unit 1 notes 2018
Liit tyit sem 5 enterprise java  unit 1 notes 2018 Liit tyit sem 5 enterprise java  unit 1 notes 2018
Liit tyit sem 5 enterprise java unit 1 notes 2018 tanujaparihar
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptxMattMarino13
 
Websphere interview Questions
Websphere interview QuestionsWebsphere interview Questions
Websphere interview Questionsgummadi1
 
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.pptweb-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt20521742
 

Similar to Servlets api overview (20)

WEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptxWEB TECHNOLOGY Unit-3.pptx
WEB TECHNOLOGY Unit-3.pptx
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
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
 
Servlets as introduction (Advanced programming)
Servlets as introduction (Advanced programming)Servlets as introduction (Advanced programming)
Servlets as introduction (Advanced programming)
 
Servlet classnotes
Servlet classnotesServlet classnotes
Servlet classnotes
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
 
Servlet.pptx
Servlet.pptxServlet.pptx
Servlet.pptx
 
Servlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, APIServlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, API
 
JAVA Servlets
JAVA ServletsJAVA Servlets
JAVA Servlets
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
UNIT-3 Servlet
UNIT-3 ServletUNIT-3 Servlet
UNIT-3 Servlet
 
Liit tyit sem 5 enterprise java unit 1 notes 2018
Liit tyit sem 5 enterprise java  unit 1 notes 2018 Liit tyit sem 5 enterprise java  unit 1 notes 2018
Liit tyit sem 5 enterprise java unit 1 notes 2018
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Websphere interview Questions
Websphere interview QuestionsWebsphere interview Questions
Websphere interview Questions
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Servlet 01
Servlet 01Servlet 01
Servlet 01
 
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.pptweb-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
 

More from ramya marichamy

NETWORK DEVICE SECURITY NETWORK HARDENING
NETWORK DEVICE SECURITY NETWORK HARDENINGNETWORK DEVICE SECURITY NETWORK HARDENING
NETWORK DEVICE SECURITY NETWORK HARDENINGramya marichamy
 
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATIONDIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATIONramya marichamy
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesramya marichamy
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentationramya marichamy
 
Mining single dimensional boolean association rules from transactional
Mining single dimensional boolean association rules from transactionalMining single dimensional boolean association rules from transactional
Mining single dimensional boolean association rules from transactionalramya marichamy
 
Architecture of data mining system
Architecture of data mining systemArchitecture of data mining system
Architecture of data mining systemramya marichamy
 
SHADOW PAGING and BUFFER MANAGEMENT
SHADOW PAGING and BUFFER MANAGEMENTSHADOW PAGING and BUFFER MANAGEMENT
SHADOW PAGING and BUFFER MANAGEMENTramya marichamy
 
pointer, virtual function and polymorphism
pointer, virtual function and polymorphismpointer, virtual function and polymorphism
pointer, virtual function and polymorphismramya marichamy
 
Managing console i/o operation,working with files
Managing console i/o operation,working with filesManaging console i/o operation,working with files
Managing console i/o operation,working with filesramya marichamy
 
microcomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instructionmicrocomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instructionramya marichamy
 

More from ramya marichamy (19)

NETWORK DEVICE SECURITY NETWORK HARDENING
NETWORK DEVICE SECURITY NETWORK HARDENINGNETWORK DEVICE SECURITY NETWORK HARDENING
NETWORK DEVICE SECURITY NETWORK HARDENING
 
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATIONDIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
DIGITAL VIDEO DATA SIZING AND OBJECT BASED ANIMATION
 
Image processing
Image processingImage processing
Image processing
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Design notation
Design notationDesign notation
Design notation
 
Mining single dimensional boolean association rules from transactional
Mining single dimensional boolean association rules from transactionalMining single dimensional boolean association rules from transactional
Mining single dimensional boolean association rules from transactional
 
Architecture of data mining system
Architecture of data mining systemArchitecture of data mining system
Architecture of data mining system
 
segmentation
segmentationsegmentation
segmentation
 
File Management
File ManagementFile Management
File Management
 
Arithmetic & Logic Unit
Arithmetic & Logic UnitArithmetic & Logic Unit
Arithmetic & Logic Unit
 
SHADOW PAGING and BUFFER MANAGEMENT
SHADOW PAGING and BUFFER MANAGEMENTSHADOW PAGING and BUFFER MANAGEMENT
SHADOW PAGING and BUFFER MANAGEMENT
 
B+ tree
B+ treeB+ tree
B+ tree
 
pointer, virtual function and polymorphism
pointer, virtual function and polymorphismpointer, virtual function and polymorphism
pointer, virtual function and polymorphism
 
Managing console i/o operation,working with files
Managing console i/o operation,working with filesManaging console i/o operation,working with files
Managing console i/o operation,working with files
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
microcomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instructionmicrocomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instruction
 
High speed lan
High speed lanHigh speed lan
High speed lan
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 

Servlets api overview

  • 1. SERVLETS API OVERVIEW PRESENTED BY M.RAMYA M.sc (CS & IT) NADAR SARASWATHI COLLEGE OF ARTS & SCIENCE, THENI.
  • 2. SERVLETS • Servlets used to create web application • Servlets are middle layer of between a request from browser or HTTP client and database application. • Servlets are robust and scalable • Servlets are platform independent • Servlets resides at server side and generates dynamic web page
  • 3. • Servlets are used to collect input through the web forms or to show records from database via web reports. • Servlets performance is significantly better than CGI. • Servlets execute within the address space of a Web server. So it is not necessary to create a separate process to handle each client request. • Servlets are secure.
  • 4. SERVLETS – DIAGRAMMATIC REPRESENTATION Web browser HTTP Server Servlet Program Database
  • 5. SERVLETS EXECUTION STEPS : • Browser or any HTTP client sent data to the HTTP Server in the form of Web Page. • The request sent by the Browser or client is read by Servlets. Request or data sent includes • Servlet then processes the data and generate the results. • Servlet then Sends data to the clients (browsers) in verity of formats which includes web page, Images, pdf or excel No. Request Sent by Browser includes 1 HTML Form 2 cookies 3 media types 4 compression schemes etc
  • 6. DIFFERENT TERMS USED IN SERVLET TECHNOLOGY : Term Description HTTP Protocol allows web servers and browsers to exchange data over the web Get and Post method Methods for a request-response data between a client and server Container Run time environment for Java EE applications Application Server A server that exposes business logic to client applications through various protocols including HTTP. Web Server A server that handles HTTP protocol. Content Type HTTP header which provides the description about what are you sending to the browser. Deployment Activity by which make a web application available for use
  • 7. SERVLET API • Before creating the first servlets, you need to understand the Servlet API and Tomcat Servlet container. The Servlet API provides interfaces and classes that are required to built servlets. These interfaces and classes are group into the following two packages : • javax.servlet • javax.servlet. Http
  • 8. JAVAX.SERVLET PACKAGE • The javax.Servlet package contains a number of interfaces and classes that establish the framework in which servlets operate. The classes and interface in this package are protocol independent. The Fig. shows classes and interfaces in this package.
  • 9.
  • 10. The javax.servlet package contains many interfaces and classes. Some of the interfaces and classes are listed in table. Interfaces Description Servlet Declares life cycle methods that all servlets must implement. ServletConfig Allows servlets to get initialization parameters ServletContext Allows servlets to communicate with its servlet container. ServletRequest Provides client request information to a servlet. ServletResponse Assist a servlet in sending a response to the client.
  • 11. Classes Description GenericServlet Provides a basic implementation of the Servlet interface for protocol independent servlets ServletlnputStream Provides an input stream for reading binary data from a client request. ServletOutputStream Provides an output stream for sending binary data to the client. ServletException Defines a general exception, a servlet can throw when it encounters difficulty. UnavailableException Indicates that a servlet is not available to service client request.
  • 12. WRITING SERVLETS • Servlet is an extension to a server that enhances the server's functionality. The most common use for a servlet is to extend a web server by providing dynamic web content • . Web servers display documents written in HyperText Markup Language (HTML) and respond to user requests using the HyperText Transfer Protocol (HTTP). • HTTP is the protocol for moving hypertext files across the internet. HTML documents contain text that has been marked up for interpretation by an HTML browser such as Netscape.
  • 13. SIMPLE SERVLETS HANDLING HTML • Handling form data represented in HTML page is a very common task in web development. A typical scenario is the user fills in fields of a form and submits it. • The server will process the request based on the submitted data, and send response back to the client.
  • 14. • To create a form in HTML we need to use the following tags: – <form>: to create a form to add fields in its body. – <input>, <select>, <text area>…: to create form fields like text boxes, dropdown list, text area, check boxes, radio buttons,… and submit button.