zoukankan      html  css  js  c++  java
  • 重定向 jsp

    当点击弹出的对话框中的确定按钮后转向另一个页面。

    out.println("<script>window.alert('您的数据转换成功!');location.href('downLoad.jsp')</script>");

    若在C#中则为:

    Response.Write("<script>window.alert('消息');location.href('Tree.aspx')</script>");

    当点击界面中的确定按钮后:对确定的判断

    <%
        if(request.getParameter("submit")!=null)
         { 
           //确保字符串中如果有中文也不会出现乱码,此方法只能对第个字段来转换,但不能对整个文件的内容来转换,eg。上传上件
           String serviceType = new String( request.getParameter("information").getBytes("iso8859-1"), "gb2312");
           request.setCharacterEncoding("gb2312");
           
           c.transit(serviceType);
         out.println("<table ALIGN=\"center\"><tr><td bgcolor=\"#EAEAEA\">匹配度:</td><td bgcolor=\"#F0FFF0\">"+c.qom+"</td></tr></table>");
     
      if(c.qom<0.75){
      out.println("<script language=\"javascript\"> alert(\"你的数据匹配度低,无法转换,请保证内容遵从行业标准\"); </script>");
      }
      else{
      //out.println("<script language=\"javascript\"> alert(\"您的数据转换成功!\"); </script>");
      out.println("<script>window.alert('您的数据转换成功!');location.href('downLoad.jsp')</script>");//当点击弹出的对话框中的确定按钮后转向另一个页面。
      }
      //response.sendRedirect("downLoad.jsp");
     } 
        %>

  • 相关阅读:
    处处留心皆学问,世事如棋局局新…
    【转载】2017 软件测试行业现状调查报告_From_51testing_On_20180625
    Hello World In Go ...
    C# 易错题整理
    C# 函数
    C# 哈希表,队列,栈
    C# 数组,集合,泛型集合
    C# 如何生成验证码
    C# 年月日时间题+Timespan
    闰年的一个BUG
  • 原文地址:https://www.cnblogs.com/guyueyanzi/p/1701367.html
Copyright © 2011-2022 走看看