0
我有一個servlet被映射到應用程序上下文根使用""
字符串: 所以當我點擊url http://127.0.0.1:8080/myapp/
,我可以看到「這是ROOT!」在瀏覽器中。到現在爲止還挺好。Eclipse/Tomcat7:應用程序上下文根重裝返回404
但是,如果我修改了某些內容,請將字符串This is ROOT!!
更改爲ROOT!!
並將該文件保存在eclipse中。 Eclipse需要幾秒鐘來重新加載上下文。 現在,如果我點擊相同的網址,404頁面顯示,而所有其他網頁仍然正常工作。只有根映射被破壞。所以我重新部署(日食的「在服務器上運行」)應用程序,根映射又回來了。關於如何解決這個問題的任何想法?
@WebServlet("")
public class Root extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("This is ROOT!!");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}