Eclipse 运行servlet出现问题,快疯了~~!

来源:百度知道 编辑:UC知道 时间:2024/09/20 14:43:57
public class test extends HttpServlet {

/**
*
*/
private static final long serialVersionUID = 1L;

public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.print("hello");
}

}

什么都设置好以后从网页输入地址,出现:
Source not found for test.doGet(HttpServletRequest, HttpServletResponse) line: 16

怎么回事啊? 期待解答~!

楼主说得再详细点,你再查一下具体第16行是哪句?

我初步推测是此句res.setContentType("text/html");的错误,没有写清楚text的路径。