What is Java Servlet
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
Architecture
Request comes from browser to HTTP server and then to servlet.
Servlet process this request and interact with database and send response via same channel.
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
Architecture
Request comes from browser to HTTP server and then to servlet.
Servlet process this request and interact with database and send response via same channel.
Servlets can be created using the javax.servlet and javax.servlet.http packages.
Methods of Servlet javax.servlet.Servlet Interface
1. Init()
2. Destroy()
3. Service()
4. getServletConfig()
5. getServletInfo()
Servlet API
Servlet API cotains 4 package
1. javax.servlet
2. javax.servlet.http
3. javax.servlet.annotation
4. javax.servlet.descriptor
javax.servlet:- Contains classes and interfaces that define the contract between a servlet and a servlet container.
javax.servlet.http:- Contains classes and interfaces that define the contract between an HTTP servlet and a servlet container.
javax.servlet.annotation:- Contains annotations to annotate servlets, filters, and listeners. It also specifies metadata for annotated components.
javax.servlet.descriptor:- Contains types that provide programmatic access to a web application’s configuration information.
javax.servlet.http:- Contains classes and interfaces that define the contract between an HTTP servlet and a servlet container.
javax.servlet.annotation:- Contains annotations to annotate servlets, filters, and listeners. It also specifies metadata for annotated components.
javax.servlet.descriptor:- Contains types that provide programmatic access to a web application’s configuration information.
Comments
Post a Comment