index.jsp中执行提交到servlet执行流格式下载如下:
                String fileName = "1233.word";
                File t_file = new File(downFilePath);                FileInputStream fis = new FileInputStream(t_file);
                ServletOutputStream fout = response.getOutputStream();
                response.setContentType("application/octet-stream;charset=utf-8");
                response.setHeader("Content-disposition", "attachment;filename=\"" + fileName + "\"");
                int byteRead;
                while ((byteRead = fis.read()) != -1) {
                    fout.write(byteRead);
                }
                fis.close();
                fout.close();                response.sendRedirect("/index.jsp");发现最后句没用,请问有没什么其他方法?我想跳转回原来的页面

解决方案 »

  1.   

    String path = request.getContextPath()+"到index.jsp的相对路径";
    response.sendRedirect(path);
    试试
      

  2.   

    路径有问题吧String   path   =   request.getContextPath()+"到index.jsp的相对路径"; 
    response.sendRedirect(path); -------
    这个可以
      

  3.   

    下载的时候popup一个窗口就行了,原来的页面不跳转 
      

  4.   

    用URL重写啊..或是超链接...让这个超链接0.1秒自动刷新.到index.jsp