samedi 11 avril 2015

error in servlet ? why

I have codes sevlet



import java.io.*;
import javax.servlet.*;

public class YourServletName 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.print("<html><body>");
out.print("<b>hello simple servlet</b>");
out.print("</body></html>");

}
public void destroy(){
System.out.println("servlet is destroyed");}
public ServletConfig getServletConfig(). {return config;}
public String getServletInfo(){return "copyright 2007-1010";}

}


When i run in eclipse luna > error > why ? HTTP Status 404 -


type Status report


message


description The requested resource is not available.




Apache Tomcat/8.0.21





Aucun commentaire:

Enregistrer un commentaire