answersLogoWhite

0


Best Answer

javax.servlet.GenericServlet

Signature: public abstract class GenericServlet extends java.lang.Object implements Servlet, ServletConfig, java.io.Serializable

  • GenericServlet defines a generic, protocol-independent servlet.
  • GenericServlet gives a blueprint and makes writing servlet easier.
  • GenericServlet provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface.
  • GenericServlet implements the log method, declared in the ServletContext interface.
  • To write a generic servlet, it is sufficient to override the abstract service method.

javax.servlet.http.HttpServlet

Signature: public abstract class HttpServlet extends GenericServlet implements java.io.Serializable

  • HttpServlet defines a HTTP protocol specific servlet.
  • HttpServlet gives a blueprint for Http servlet and makes writing them easier.
  • HttpServlet extends the GenericServlet and hence inherits the properties GenericServlet.
User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Generic Servlet and HTTP Servlet
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are types of servlet?

Http servlet and Generic servlet


Difference between HTTP servlet and Generic servlet?

The difference is that a GenericServlet has no defined protocol (it is "generic"), while HttpServler uses the HTTP protocol. HttpServlet is a subclass of GenericServlet with the purpose of creating a servlet for a web site.


What is generic servlet class?

GenericServlet defines a generic, protocol-independent servlet whereas HttpServlet Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site that uses the Http Protocol.


How much is escada ocean lounge perfume?

Depends. 1 oz $24.50 http://www.scential.com/servlet/the-13524/Escada/Detail 1.7 oz $25.75 http://www.scential.com/servlet/the-11077/Escada-escada-ocean-lounge/Detail 3.4 oz $40.00 http://www.scential.com/servlet/the-3166/escada-ocean-lounge%2C-perfume%2C/Detail


What servlet API used for database connection?

The Servlet 2.3 API consists of two packages: javax.servlet and javax.servlet.http. The base functionality is defined in the javax.servlet package whose classes and interfaces outline a generic, protocol-independent implementation. This means you can use it for non-Web applications, too. The javax.servlet.http interface defines classes and interfaces that are specific to the Hypertext Transfer Protocol (HTTP).


Where can i find Power window control switch for explorer 2002?

http://www.conquestauto.com/servlet/the-1850/2002-dsh-2002--Ford-Explorer/Detail http://www.conquestauto.com/servlet/the-1850/2002-dsh-2002--Ford-Explorer/Detail


What use import javaxservlethttpHttpServletRequest in java?

The Http RequestWhen a user hits a URL with a servlet at the other end, the Servlet Container creates an HttpServletRequest object. It passes this object as an argument to the servlet's service methods (doPut(), doGet(), and doPost()). There is a lot of information in this object, including the login details of the user making this request and the name of the HTTP method with which this request was made.


How does Apache httpd work?

Tomcat is a servlet container, and the following is how a servlet container works The init, service, and destroy methods are the servlet's lifecycle methods. The init method is called once by the servlet container after the servlet class has been instantiated to indicate to the servlet that it being placed into service. The init method must complete successfully before the servlet can receive any requests. A servlet programmer can override this method to write initialization code that needs to run only once, such as loading a database driver, initializing values, and so on. In other cases, this method is normally left blank. The service method is then called by the servlet container to allow the servlet to respond to a request. The servlet container passes a javax.servlet.ServletRequest object and a javax.servlet.ServletResponse object. The ServletRequest object contains the client's HTTP request information and the ServletResponse encapsulates the servlet's response. These two objects enable you to write custom code that determines how the servlet services the client request. The servlet container calls the destroy method before removing a servlet instance from service. This normally happens when the servlet container is shut down or when the servlet container needs some free memory. This method is called only after all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls destroy, it will not call the service method again on this servlet. The destroy method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, and threads) and make sure that any persistent state is synchronized with the servlet's current state in memory. For Better Picture, Visit below article full of images to clear the concept : http://shivasoft.in/blog/java/servlet/how-container-handles-the-servlet-request/


What is java servlet chaining?

Servlet Chaining means the output of one servlet act as a input to another servlet. Servlet Aliasing allows us to invoke more than one servlet in sequence when the URL is opened with a common servlet alias. The output from first Servlet is sent as input to other Servlet and so on. The Output from the last Servlet is sent back to the browser. The entire process is called Servlet Chaining.


What class is a new servlet usually inherited?

The servlet class created in web applications usually extend the javax.servlet.HttpServlet class. The HttpServlet extends the javax.servlet.GenericServlet. These classes contain the basic features that are required to run a web application.


How do you Retrieve data from drop down box in one servlet and pass to another servlet?

The data that is present in a web page is available in the Form object of the page which can be accessed from the HTTP Request. If the request object gets passed from one servlet to another the data also would get passed.


Where can you get a good Zelda costume from Twilight Princess?

This is where you can get it: http://www.adventanimeonline.com/servlet/the-2774/The-Legend-of-Zelda/Detail