2.2 Servlet API about enterprise edision resourse programing.pptx

SivaKiranBalasani 3 views 16 slides Mar 23, 2024
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

this is about full stack backend servlets Today we all are aware of the need to create dynamic web pages i.e. the ones that can change the site contents according to the time or can generate the content according to the request received by the client. If you like coding in Java, then you will be hap...


Slide Content

Java Enterprise

Jakarta Servlet Methods Servlet Classes Servlet Interface Servlets API

S E R V L E T

Servlet API Servlet API contains a number of classes and interfaces that describe the contracts between a servlet class and the runtime environment provided for an instance by a conforming servlet container. Servlet API provides the following two packages that contain its classes and interfaces: javax.servlet .*; Classes and interfaces defines the contracts between a Servlet class and the runtime environment provided for an instance of such a class by a conforming Servlet container. javax.servlet.http .*; Classes and interfaces defines the contracts between a Servlet class running under the HTTP protocol and the runtime environment provided for an instance of such a class by a conforming Servlet container.

Servlet Serialization Servlet Config Generic Servlet Http Servlet User Defined Servlet INTERFACES BUILD IN CLASSES

Generic Servlet Abstract Class GenericServlet implements Servlet interface It defines Servlet generic and independent of protocols It doesn’t give implementation for service method of Servlet interface If your Servlet Generic class, then it should implement service method

Generic Servlet Abstract Class Method

Generic Servlet Abstract Class Method

Http Servlet Abstract Class Method

init service destroy getServletInfo getServletConfig Init method is called by Servlet container to indicate to a Servlet that it is being placed into service. Declaration : void init ( ServletConfig config )

init service destroy getServletInfo getServletConfig Service method is called by the Servlet container to allow the Servlet to respond to a request. Declaration : public void service( HttpServletRequest req , HttpServletResponse res) throws ServletException , java.io.IOException

init service destroy getServletInfo getServletConfig Destroy method indicates that the Servlet is being taken out of service Declaration : public void destroy()

init service destroy getServletInfo getServletConfig getServletInfo method returns information about the Servlet Declaration : public String getServletInfo ()

init service destroy getServletInfo getServletConfig Returns a ServletConfig object that contains initialization and start-up parameters for this Servlet Declaration : public ServletConfig getServletConfig ()

Thank You