我正在使用Eclipse Juno版本,Tomcat Server。 我创建了一个动态Web项目,在其中我创建了html页面和相关的servlet。 我使用requestDispatcher从servlet调用了一个html页面。 它对我来说很好,几天后,我在requestDispatcher中更改了html页面的名称。 它没有识别新的html页面,它只显示旧的html页面。
我试图解决这个问题。我重新启动了tomcat,清理了tomcat服务器,重新启动了eclipse,
刷新项目,但它仍然只显示较旧的html页面。
如何解决此问题? 请有人帮助我。
THANKYOU。
公共类MeatServlet扩展了HttpServlet { private static final long serialVersionUID = 1L;
public MeatServlet() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String Chicken=request.getParameter("Chicken - 1lb");
String Goat = request.getParameter("Goat - 1lb");
String ChickenHalal = request.getParameter("Chicken Halal - 1lb");
String GoatHalal = request.getParameter("Goat Halal - 1lb");
HttpSession session = request.getSession();
session.setAttribute("Chicken - 1lb", Chicken);
session.setAttribute("Goat - 1lb", Goat);
session.setAttribute("Chicken Halal - 1lb", ChickenHalal);
session.setAttribute("Goat Halal - 1lb", GoatHalal);
ServletContext c = getServletContext();
RequestDispatcher rs = c.getRequestDispatcher("/TotalList.html");
rs.forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}
公共类MeatServlet扩展了HttpServlet { private static final long serialVersionUID = 1L;
public MeatServlet() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String Chicken=request.getParameter("Chicken - 1lb");
String Goat = request.getParameter("Goat - 1lb");
String ChickenHalal = request.getParameter("Chicken Halal - 1lb");
String GoatHalal = request.getParameter("Goat Halal - 1lb");
HttpSession session = request.getSession();
session.setAttribute("Chicken - 1lb", Chicken);
session.setAttribute("Goat - 1lb", Goat);
session.setAttribute("Chicken Halal - 1lb", ChickenHalal);
session.setAttribute("Goat Halal - 1lb", GoatHalal);
ServletContext c = getServletContext();
RequestDispatcher rs = c.getRequestDispatcher("/Online.html");
rs.forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}