0% found this document useful (0 votes)
18 views2 pages

Deployjav

Uploaded by

riya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Deployjav

Uploaded by

riya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

• Every servlet must implement javax.servlet.

Servlet interface

• Most servlets implement the interface by extending one of these classes

– javax.servlet.GenericServlet

– javax.servlet.http.HttpServlet

Definitions

• A Servlet does not run in a separate process.

• A Servlet stays in memory between requests.

• A CGI program needs to be loaded and started for each CGI request.

• There is only a single instance of a servlet which answers all requests concurrently.

• Defines an object to assist a servlet in sending a response to the client.

• The servlet container creates a ServletResponse object and passes it as an argument to the
servlet's service method.

• The deployment descriptor is a XML file called web.xml that resides in the WEB-INF directory
whitin an application.

<web-app xmlns=http://java.sun.com/xml/ns/j2ee……>
<display-name>test</display-name>

<description>test example</description>

<servlet>

<servlet-name>Testing</servlet-name>

<servlet-class>TestingServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>Testing</servlet-name>

<url-pattern>/servlet/TestingServlet</url-pattern>

</servlet-mapping>

</web-app>

• In the Servlet container each application is represented by a servlet context

• each servlet context is identified by a unique path prefix called context path

– For example our application is identified by /myApp which is a directory under


webapps.

• The remaining path is used in the selected context to find the specific Servlet to run,
following the rules specified in the deployment descriptor.

• In the Servlet container each application is represented by a servlet context

• each servlet context is identified by a unique path prefix called context path

– For example our application is identified by /myApp which is a directory under


webapps.

• The remaining path is used in the selected context to find the specific Servlet to run,
following the rules specified in the deployment descriptor.

You might also like