你写2个action不就好了,据说我所知,struts没有这样的把,springmvc可以的!

解决方案 »

  1.   

    action可以继承DispatchAction来执行不同的action代码
      

  2.   

    如果不想用dispatchaction的话把要访问的页面改成localhost/topic.jsp?id=10&action=show提交地址改成xxxx.do?action=commit然后action的excute方法里判断String actionname=request.getParameter("action");
    if(actionname.equals("show")){
      //xxxxxxx
    }else if(actionname.equals("commit")){
      //yyyyyyy
    }