out.print("<script>alert(\"留言失败!\"); history.go(-1);</script>");

解决方案 »

  1.   

    //显示提示信息,并跳转到指定地址
      public String GotoURL(String Info,String AddURL)
      { String TheInfo="";
       TheInfo="<script>alert(\""+Info+"\"); location.href=\""+AddURL+"\";</script>";
       return TheInfo;
      }
      
      //显示提示信息,并返回前一页
      public String GotoBackURL(String Info)
      { String TheInfo="";
       TheInfo="<script>alert(\""+Info+"\"); history.go(-1); </script>";
       return TheInfo;
      }
      
      //显示提示信息,并返回前两页
      public String GotoBack2URL(String Info)
      { String TheInfo="";
       TheInfo="<script>alert(\""+Info+"\"); history.go(-2); </script>";
       return TheInfo;
      }
      
      //显示提示信息,Top返回到指定地址
      public String GotoTopURL(String Info,String AddURL)
      { String TheInfo="";
       TheInfo="<script>alert(\""+Info+"\"); top.location.href=\""+AddURL+"\";</script>";
       return TheInfo;
      }
      
      //不显示提示信息就转到指定地址
      public String GotoURLNoInfo(String AddURL)
      { String TheInfo="";
        TheInfo="<script>location.href=\""+AddURL+"\";</script>";
        return TheInfo;
      }