页面 :<a href="" onclick="delete2(${s.partofWorkflow},${s.stepId})"> 删除</a>js: 
Struts :  
<action name="delete223" class="com.engineering.systemTM.action.UserAction"  method="delete22">
    <result name="success" type="json" />
    <result name="error">/error.jsp</result>
    </action>public String delete22()throws Exception{  //日志删除
String liucheng11=getLiucheng11();
String step11=getStep11();
System.out.println("Step11+++++==="+step11);
int canp =server.findstep(liucheng11,step11);
//int tt=Integer.parseInt(session.get("userId").toString());
//System.out.println("id===="+userid);
  //int canp= save1.quanxian(tt, GlobalVar.Logdelete);
     
     System.out.println("日志删除="+canp);
   
     if(canp!=0){
       throw new Exception("此步骤是某步骤的上一步 ,不能删除");}else{
       // System.out.println("日志删除456="+canp);
      return SUCCESS; 
      }
     
}
怎么办 求帮助 javaweb

解决方案 »

  1.   

    <a href="javascript:;" onclick="delete2(${s.partofWorkflow},${s.stepId})"> 删除</a>在看下  alert(stepid); 可以不 。
      

  2.   

    首先你是ajax请求,action不会主动跳转页面
    其次,你没有输出流,ajax接受不到服务端的响应。说白了,你的ajax请求是一去不复返。
    你现在要加的代码就是服务端要加一个response.getWrite().print();
      

  3.   

    debug下后台,你提交后执行的结果是success还是error,如果是error,你跳的是另一个jsp。理论上你失败了应该还是一个json的返回才对。
      

  4.   

    如果alert没有执行,把onclick中的el表达式用单引号括起来试试!
      

  5.   

    你这个要返回值时json类型的,或者你得有输出流个response.getWrite().print(); ,能让js捕获到
      

  6.   

    你的应该是对的   <a href="javascript:void(0);" 我这样写就行了 。