用maven写了几句简单的代码,打包成war包后,在本机上运行无误,发布到ijetty上的时候,报出这样的错误 Servlet Not Initialized</pre></p><h3>Caused by:</h3><pre>javax.servlet.UnavailableException,请问一下哪位大虾知道是什么情况啊?
Servlet的代码:
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Servlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void init() throws ServletException {
// TODO Auto-generated method stub
super.init();
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
PrintWriter out = resp.getWriter();
out.print("hello");
out.flush();
out.close();
}
}
------解决方案--------------------
本机也用jetty吗?