js返回页面的问题:例:
index.jsp页面有个超链接,可以跳转到index2.jsp页面中,
index2.jsp页面中也有个链接或button,要跳回到index.jsp页面中,现在问题是:如果index.jsp页面中超链接跳转后,新打开一个到index2.jsp页面中,再想从index2.jsp页面中返回到index.jsp页面中,是返回,返回到已打开了的index.jsp页面中。而不是重新打开一个页面。求大牛指点。。谢谢。。
index.jsp页面有个超链接,可以跳转到index2.jsp页面中,
index2.jsp页面中也有个链接或button,要跳回到index.jsp页面中,现在问题是:如果index.jsp页面中超链接跳转后,新打开一个到index2.jsp页面中,再想从index2.jsp页面中返回到index.jsp页面中,是返回,返回到已打开了的index.jsp页面中。而不是重新打开一个页面。求大牛指点。。谢谢。。
解决方案 »
- hibernate 数据字典取值问题
- 大家好 问个问题 弄来弄去没弄好 JDBC连 ORACLE9i的异常(java.sql.SQLException: Io 异常: The Network A)
- 为什么localhost不好用 127.0.0.1好用??
- 关于struts图片上传问题的思考!!!
- 关于struts中的标签logic:iterate
- 请问各位高手这个错误是什么意思?
- 问一个Hibernate配置文件的问题
- 想换程序学习的网友请进。
- 小妹急啊!在线jbuilder9中用tomcat5.0出现"index.jsp": java.lang.NoClassDefFoundError: org/apache/jasper/JspC,
- 使用JBuilder9+WebLogic6.1,如何编译、调试、部署EJB?
- struts2配置文件根对象root问题?
- Servlet综合性问题,求解答、求告知
里面的复数就是离当前页的历史页数,-1就是之前的页。
你点一下,想返回到已打开了的index.jsp页面中。而不是重新打开一个页面。
这个实现难度真的挺高。
在当前页面跳转容易,在当前页面通过按钮切换到另一个页面,暂时还没见过这技术。
function CopyImage(img) {
//var img=$("#img_wheel");
var ctrl = document.body.createControlRange();
img.contentEditable = true;
ctrl.addElement(img);
ctrl.execCommand('Copy');
img.contentEditable = false;
alert('复制图片完成');
}
String imgurl=request.getParameter("imgUrl");
imgurl="http://localhost:8080/nods/"+imgurl;
URL url = new URL(imgurl);
System.out.println(imgurl);
URLConnection conn = url.openConnection();
//File file=new File(imgurl);
BufferedImage bi = ImageIO.read(conn.getInputStream());
ByteArrayOutputStream ba = new ByteArrayOutputStream();
ImageIO.write(bi, "PNG", ba);
response.setContentType("image/png");
response.setContentLength(ba.size());
String fileName = Calendar.getInstance().getTimeInMillis()+".png";
String headerStr = "attachment;filename=" + fileName;
response.setHeader("Content-Disposition", new String(headerStr.getBytes("GBK"), "ISO-8859-1"));
ServletOutputStream out =response.getOutputStream();
ba.writeTo(out);
out.flush();
out.close();
各位,这个下载图片的代码,执行后为什么没有反应呢,是不是哪有错呢,但是也没有抛出异常啊。这是什么情况?求指教
你异常抓取的部分,抓的是什么异常? 你catch(RuntimeException re) 试试,看是否有异常信息提示
再不行去请求后台action从action跳转到index.jsp
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
String imgurl=request.getParameter("imgUrl");
imgurl="http://localhost:8080/nods/"+imgurl;
URL url = new URL(imgurl);
System.out.println(imgurl);
URLConnection conn = url.openConnection();
//File file=new File(imgurl);
BufferedImage bi = ImageIO.read(conn.getInputStream());
ByteArrayOutputStream ba = new ByteArrayOutputStream();
ImageIO.write(bi, "PNG", ba);
response.setContentType("image/png");
response.setContentLength(ba.size());
String fileName = Calendar.getInstance().getTimeInMillis()+".png";
String headerStr = "attachment;filename=" + fileName;
response.setHeader("Content-Disposition", new String(headerStr.getBytes("GBK"), "ISO-8859-1"));
ServletOutputStream out =response.getOutputStream();
ba.writeTo(out);
out.flush();
out.close();