编写以下代码时, FirstServlet 类名前忘了写public关键字,结果一直报Error instantiating servlet class,写上public关键字就好了.
package com.taiyusheng;
import java.io.;
import javax.servlet.;
public class FirstServlet extends GenericServlet {
public void service(ServletRequest req, ServletResponse res) throws ServletException, java.io.IOException{
res.getWriter().write(“Hello Servlet!”);
}
}