在配置里面 再加一句
<result name="input">错误页面</result>

解决方案 »

  1.   

    这样的话可以不报页面上的404 错误了
    至于后台的NumberFormatException 错误应该能定位到哪一行吧
      

  2.   

    NumberFormatException 错误
      是因为你的页面上传过来的userIds 数组 里面的值不能转为long类型  不全部都是数字
      

  3.   


    加了一样的   页面传过来的 就是一个userId   是STRING类型的  我转换了  
      

  4.   

    我debug了的  就是执行不到那个断点  当传过来的是userId 是一个的时候正常执行  当是2个时候 就出问题了  断点没反应  举得很奇怪  好像根本没执行deleteUser()一样
      

  5.   

    传过来是2个id以上  断点等于没有??你的断点设置在哪儿呢?还有那个配置文件中的result 的name 为error
      

  6.   

    public String deleteUser(){
    String[] userIds = request.getParameterValues("userId");
    for(int i = 0 ; i < userIds.length ; i++) {
    //long userId = new Long(userIds[i]).longValue();
    userId=Long.parseLong(userIds[i]);
    System.out.println("asasasasas======="+userId);
    userDao.removeAll(userId);
    }
         return SUCCESS;
    }
    我现在把那个判断去掉了  直接获取传过来的参数   
    在String[] userIds = request.getParameterValues("userId"); 设置的断点  没反应  
    当传的是1个userId的时候程序正常执行  
      

  7.   

    No result defined for action *.actions.UsersAc and result input有一个result页面找不到  你没设置?java.lang.NumberFormatException: For input string: "[Ljava.lang.String;@1df7db4"格式转换错误 看看在前台列表 把什么转错了
      

  8.   


    public String deleteUser(){
    String[] userIds = request.getParameterValues("userId");
    if(null == userIds || userIds.length() == 0) {
    msg = "请选择要删除的用户!";
    return ERROR;
    }for(int i = 0 ; i < userIds.length ; i++) {
    long userId=Long.parseLong(userIds[i]);
    System.out.println("asasasasas======="+userId);
    userDao.removeAll(userId);
    }return SUCCESS;
    }
    这样就行了
    request.getParameter("userId")这句在有2个checkbox的时候有毛病
      

  9.   

    public String deleteUser(){if(request.getParameter("userId") == null) {
    msg = "请选择要删除的用户!";
    return ERROR;
    }else {String[] userIds = request.getParameterValues("userId");
    for(int i = 0 ; i < userIds.length ; i++) {
    //long userId = new Long(userIds[i]).longValue();
    long userId=Long.parseLong(userIds[i]);
    System.out.println("asasasasas======="+userId);
    userDao.removeAll(userId);
    }return SUCCESS;
    }
    }
      

  10.   


    就2个页面  一个正确的  一个错误的    从前台页面获取一个userId  转换成long型  就这样的 
      

  11.   

    public String deleteUser(){if(request.getParameter("userId") == null) {
    msg = "请选择要删除的用户!";
    return ERROR;
    }else {
    String[] userIds = request.getParameterValues("userId");
    for(int i = 0 ; i < userIds.length ; i++) {
    long userId=Long.parseLong(userIds[i]);
    System.out.println("asasasasas======="+userId);
    userDao.removeAll(userId);
    }return SUCCESS;
    }
    }上面的加颜色失败了
      

  12.   

     复选框用struts2的 什么问题就解决了!
      

  13.   

    第一 我分析 你在return ERROR;时找不到这个页面报了 no result的错误 然后程序继续执行 
    request.getParameter("userId") 是null  所以报了 转换格式出错  ???
     
      

  14.   

    String[] userIds = request.getParameterValues("userId");
      struts2中这句根本就是多余的!只要的name和你action中的变量名是一样的,即get对应的上。
     即你直接可在你的ACTION中定义String[] userId;即可自动获取到复选框中所有选中的value。
      

  15.   


    就是我这个主题帖的错误啊  一模一样的  单个userId是没问题的  为什么多个就出问题