刚开始是这样的
后来又刷新了一遍
我已经快疯了,网上说是类名不对,可是我的是对的啊
package MyServelet;
import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class MyFirstServelet implements Servlet
{
@Override
public void destroy() {
// TODO Auto-generated method stub
System.out.println("destroy");
}
@Override
public ServletConfig getServletConfig() {
// TODO Auto-generated method stub
System.out.println("getServletConfig");
return null;
}
@Override
public String getServletInfo() {
// TODO Auto-generated method stub
System.out.println("getServletInfo");
return null;
}
@Override
public void init(ServletConfig arg0) throws ServletException {
// TODO Auto-generated method stub
System.out.println("init");
}
@Override
public void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("service");
}
public MyFirstServelet()
{
System.out.println("我成功了。。。。。");
}
}
<?xml version="1.0" encoding="UTF-8"?>
hello
<servlet-class>MyServelet.MyFirstServelet</servlet-class>
hello
/happy