应该是在删除的时候用到。就像你查询操作所请求的URL应该是/showlist.do?method=query,那么ProductDispatchAction将调用method参数值所定义的方法(就是query)。同样,del就是执行del方法定义方式和query一样

解决方案 »

  1.   

    在用户登陆成功的success.jsp有个<a href="/showlist.do?method=query">查看商品列表  </a>
    在productlist.jsp显示所有商品,/showlist.do?method=del     是不是用在:
    <a href="/showlist.do?method=del ">删除 </a>
    如果是这样的话,那商品的ID怎么传过去啊?
    public boolean delproduct(HttpServletRequest request) {
            boolean b =true;
            try {
                Connection conn = ConnDB.connAccess();
                String id = request.getParameter("id");
                String sql = "delete from product where productid=";
                sql += id;
                Statement stm = conn.createStatement();
                stm.executeUpdate(sql);
            } catch (Exception e) {
                System.out.println(e.toString());
            }
             return b;
        }我这样写对吗?
      

  2.   

    是不是用另一个JSP文件来啊=====================forward 到哪个jsp是你决定的,DispatchAction对这没限制。
      

  3.   

    商品ID是在你页面的隐藏域中,你可查看一下页面的源代码,肯定能发现id的隐藏域和值
      

  4.   

    <a   href= "/showlist.do?method=del&id=${}  ">
    你在页面肯定会对productlist进行循环,循环过程中肯定能得到每条记录的id号 
      

  5.   

    ID通过表单传递,在ActionForm 中。。
      

  6.   

    <a       href=   "/showlist.do?method=del&id=${}     ">   ???这个Struts2才支持吧。