answersLogoWhite

0


Best Answer

The javax.servlet package defines 12 interfaces, 7 classes, and 2 exceptions. The Interfaces are as follows:

Filter:- Preprocessor of the request before it reaches a servlet. It can also be a postprocessor of the response leaving a servlet. It can modify a request or response (for example, change headers), the request to a resource (a servlet or static content), or the response from a resource.

RequestDispatcher:- This is the servlet version of a redirect. It enables requests to be processed and then forwarded to other components of a Web application, such as another servlet, HTML file, or JSP file.

Servlet:- Defines the life-cycle methods that are implemented by all servlets.

ServletConfig:- This class has the methods for accessing the servlet configuration information such as the servlets name (from the web.xml file), the initialization parameters, and the ServletContext object.

ServletContext:- These methods enable your servlet to communicate with its servlet container. This is how you get the MIME type of a file, dispatch requests, or write to a log file. Notice that this information has application scope. The most important features of the ServletContext are application-scope attributes access, logging, and context initialization parameters.

ServletContextAttributeListener:- Implementations of this interface receive notifications of changes to the attribute list on the servlet context of a Web application. Supports the handling of the ServletContextAttributeEvent class.

ServletContextListener:- An interface that supports the handling of the ServletContextEvent class. Defines a set of methods that a servlet uses to communicate with its servlet container. It can get the MIME type of a file, dispatch requests, or write to a log file. Notice that there is one context per "Web application" per Java Virtual Machine. The specification defines a "Web application" as a collection of servlets and content installed under a specific subset of the server's URL namespace, such as /catalog, and possibly installed via a .war file.

ServletRequest:- This interface forms the base for the class that provides client request information to a servlet. It is protocol-independent.

ServletResponse:- This interface forms the base for the class that represents the response sent from the servlet to the client.

SingleThreadModel:- An interface that ensures a given servlet handles only one request at a time.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many interfaces in a java servlet package?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Import a package second time in Java?

You can import a package as many times as you want in Java. The compiler will just ignore any duplicates.


What is Java Servlet?

A java servlet is the heart of a Java Enterprise web application. It contains most of the business logic that the web application needs. The initial web application technologies did not have capabilities to support dynamic contents in a secure and efficient way. Java Servlets were created to address this drawback. Servlets are used in many types of Java EE applications using technologies like Struts, MVC etc.


Is Interfaces in Java a kind of polymorphism?

No. Interfaces in Java are a construct to get polymorphism ( subtype polymorphism ) working in Java, but they are not a "kind" of polymorphism. In polymorphism happens when two objects respond to the same message ( method call ) in different way ( hence poly -> many, morphism -> way or shape : polymorphism -> many ways). In Java to be able to send the same message to two different objects you have to either inherit the same parent, or implement the same interface.


How many package and import statements are allowed in a java source file?

package - only one imports - unlimited. You can have as many import statements in your class as you want.


What is the difference between java and android?

Java is a virtual-machine-based programming language that can run on many different platforms, while Android is an operating system that directly interfaces with a specific type of hardware.


On Java EE IDE Eclipse what is the package name?

For beginning use of Eclipse when creating a class file leave the package name blank and it will automatically default to your current project. Packages are used in programs with many classes, interfaces, etc. to group similar aspects of the program together to make for better organization. ----I don't know what you mean by creating a class file but i am trying to create a new project and where it sais package name i have no clue what to put and when i leave blank it sais "Package name must be specified" please help


Does java support the concepts of multiple inheritance and pointers?

No. Java was designed with programmer friendliness and ease of maintenance of code in mind. Pointers makes code pretty complicated and providing direct access to the memory can have devastating effects in the hand of a mailcious or an inexperienced programmer. Also, direct multiple inheritance is not supported by java. You can achieve partial multiple inheritance with the help of Interfaces.


Use of java.util package?

The java.util package contains many useful utilities provided by the Java programming language. They include:Collections - ArrayList, Vector, HashMap etcEvent modelsDate & time featuresString tokenizerRandom number generatoretc.


What are the two types of java?

Java is a programming language that has two main types: Java SE (Standard Edition): This is the core Java language that provides all the basic features and functionalities of Java. It includes the Java Virtual Machine (JVM), which is responsible for running Java programs, and the Java Development Kit (JDK), which is used for developing Java applications. Java EE (Enterprise Edition): This is a set of Java APIs (Application Programming Interfaces) and technologies that are used for developing large-scale, distributed, and enterprise-level applications. Java EE includes a variety of APIs such as Servlets, JSPs, EJBs, JPA, JMS, and many others. These APIs provide a rich set of features for developing complex and robust enterprise applications. For more information, please visit: 1stepGrow


What is the meaning of java.lang.math?

java.lang is a package in Java which includes many of the basic classes needed by every Java program.java.lang.Math is one of those packages, which includes methods for common mathematical functions, such as: absolute value, logarithms, trigonometric functions, etc.


How many packages are there?

java has five types of keywordsthose are:1.system package2.utilities package3.networking package4.Abstract Window Tool package5.applet package


How many scope are there in servlet?

The two scopes are: Request & Session