servlet doubt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 2147483648
    New Member
    • Feb 2014
    • 11

    servlet doubt

    In the below servlet pgm,excuting fine but destroy method and two more meothds im unable to find output in console/browser?
    Plz help frnds......

    Code:
    package org.g2e.secondapp;
    import java.io.*;
    import javax.servlet.*;
    public class Servlet2 implements Servlet{
    ServletConfig config=null;
    public void init(ServletConfig config){
    	this.config=config;
    	System.out.println("servlet is initialized");
    	
    }
    public void service(ServletRequest req,ServletResponse res)throws IOException,ServletException{
    
    	res.setContentType("text/html");
    	PrintWriter out=res.getWriter();  
    	out.println("<html><body>");  
    	out.println("<b>hello simple servlet</b>");  
    	out.println("</body></html>");  
    	  
    	
    }
    
    public ServletConfig getServletConfig(){
    	return config;
    }
    public String getServletInfo(){
    	return "copyright 2007-1010";
    }
    
    public void destroy(){
    	System.out.println("servlet is destroyed");
    }
    }
    Last edited by Rabbit; Feb 1 '14, 09:36 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
Working...