java.lang.IllegalStateException: ServletConfig has not been initialized
at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:197)
at net.wecash.crawler.controller.StartServlet.init(StartServlet.java:20)
这里的代码
class="java"> @Override
public void init(ServletConfig config) throws ServletException
{
super.init(config);
factory=CrawlerUtils.getCrawlerFactory();
this.getServletContext().setAttribute("factory", factory);
System.out.println("init");
}
之前没有super.inti(config)导致了这个
错误。