GoConqr has a new look! Let us know what you think.

Notes

Servlet

Lakshya Sharma Arcesium English 6 pages

Content of the notes (6)

Page 1

service

post

get

put

trace

delete

options

content type

text/html

text/plain

application/msword

application/vnd.ms-excel

application/jar

application/pdf

application/octet-stream

application/x-zip

images/jpeg

images/png

images/gif

audio/mp3

video/mp4

video/quicktime etc.

Page 2

Classes in javax.servlet package

There are many classes in javax.servlet package. They are as follows:

GenericServlet

ServletInputStream

ServletOutputStream

ServletRequestWrapper

ServletResponseWrapper

ServletRequestEvent

ServletContextEvent

ServletRequestAttributeEvent

Interfaces in javax.servlet package

There are many interfaces in javax.servlet package. They are as follows:

Servlet

ServletRequest

ServletResponse

RequestDispatcher

ServletConfig

ServletContext

SingleThreadModel

Filter

FilterConfig

FilterChain

ServletRequestListener

ServletRequestAttributeListener

ServletContextListener

ServletContextAttributeListener

ServletContextAttributeEvent

ServletException

UnavailableException

Interfaces in javax.servlet.http package

There are many interfaces in javax.servlet.http package. They are as follows:

HttpServletRequest

HttpServletResponse

HttpSession

HttpSessionListener

HttpSessionAttributeListener

HttpSessionBindingListener

HttpSessionActivationListener

HttpSessionContext (deprecated now)

Classes in javax.servlet.http package

There are many classes in javax.servlet.http package. They are as follows:

HttpServlet

Cookie

HttpServletRequestWrapper

HttpServletResponseWrapper

HttpSessionEvent

HttpSessionBindingEvent

HttpUtils (deprecated now)

Page 3

5 methods in servlet interface

public void init(ServletConfig config) initializes the servlet. It is the life cycle method of servlet and invoked by the web container only once.

public void service(ServletRequest request,ServletResponse response) provides response for the incoming request. It is invoked at each request by the web container.

public void destroy() is invoked only once and indicates that servlet is being destroyed.

public ServletConfig getServletConfig() returns the object of ServletConfig.

public String getServletInfo() returns information about servlet such as writer, copyright, version etc.

Page 4

Tomcat Architecture (server.xml)

This instance can be broken down into a set of containers including a server, a service, a connector, an engine, a host, and a context. By default, each of these containers is configured using the server.xml

Server

It is the whole container, whose interface if specified and rarely modified by the user.

It owns a port that is used to shut down the server.

Only one instance of the Server can be created inside a given Java Virtual Machine (JVM)but separate Servers configured to different ports can be set up on a single machine to separate applications so that they can be restarted independently. That is, if one Server running in a JVM were to crash, the other applications would be safe in another Server instance.

All implementations of Server support the following attributes: className, address, port, shutdown, debug.

Service

A Service is an intermediate combination of one or more Connector components which lives inside a Server and ties one or more Connectors to exactly one Engine. The Service element is rarely customized by users, as the default implementation is simple and sufficient

Page 5

Page 6

Information

Description
Arcesium Note on Servlet, created by Lakshya Sharma on 04/03/2018.
Created by
Lakshya Sharma
Views
2
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?