Define ServletInputStream »



The ServletInputStream Class The ServletInputStream class extends InputStream. It is implemented by the server and provides an input stream that a servlet developer can use to read the data from a client request. It defines the default constructor. In addition, a method is provided to read bytes from the stream. Its signature is shown here: [...]

Define ServletOutputStream »



The ServletOutputStream Class The ServletOutputStream class extends OutputStream.It is implemented by the server and provides an output stream that a servlet developer can use to write data to a client response. A default constructor is define.It also defines the print() and println() method, which output data to the stream Sample example by using ServletOutputStream Class [...]

Can we call destroy() method on servlets from service method »



we can call the destroy() method. but it works like normal method , for example ,if u have one method in ur servlet class like show(), it acts like show() method. whenever we click on the stop link in manager page of that particular application,then only application will be stopped and it calls the destory [...]

Example programs of lifecycle of servlets »



A Generic servlet contains the following five methods: init(): public void init(ServletConfig config) throws ServletException init() method :This Method is called only once by the servlet container throughout the life of a servlet. By this init() method the servlet get to know that it has been placed into service. The servlet cannot be put into [...]