重定向 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");
 } 
    %>

转载于:https://www.cnblogs.com/guyueyanzi/archive/2010/03/31/1701367.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值