用struts1.2写的一个简单的页面a.jsp:
<%@ page language="java" pageEncoding="UTF-8"%><%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<head>
<html:base />
<title>index.jsp</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<script type="text/javascript">
function open(){
var djbh=document.getElementByName('djbh').value;
window.open('MyHtml.html','','');
}
</script>
<table border="0">
<tr>
<td>
<input name="djbh" value="52524523452" type="hidden"/>
<html:submit value="Test" onclick="open();"></html:submit>
</td>
</tr>
</table> </body>
</html:html>
为什么点击按钮的时候IE会转到空白页,IE状态栏显示“正在从以下站点下载:about:blank”;按道理应该会打开一个窗口的啊。如果有另外一个struts页面b.jsp,我希望点击按钮时,b.jsp作为一个弹出窗口弹出该怎么写?另外如果我同时希望把a.jsp页面中隐藏的"djbh"的值作为参数传递给b.jsp,又该怎么写?就像这样:http://localhost:8080/upload/b.jsp?djbh=52524523452.各位指点指点啊,急用。
<%@ page language="java" pageEncoding="UTF-8"%><%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<head>
<html:base />
<title>index.jsp</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<script type="text/javascript">
function open(){
var djbh=document.getElementByName('djbh').value;
window.open('MyHtml.html','','');
}
</script>
<table border="0">
<tr>
<td>
<input name="djbh" value="52524523452" type="hidden"/>
<html:submit value="Test" onclick="open();"></html:submit>
</td>
</tr>
</table> </body>
</html:html>
为什么点击按钮的时候IE会转到空白页,IE状态栏显示“正在从以下站点下载:about:blank”;按道理应该会打开一个窗口的啊。如果有另外一个struts页面b.jsp,我希望点击按钮时,b.jsp作为一个弹出窗口弹出该怎么写?另外如果我同时希望把a.jsp页面中隐藏的"djbh"的值作为参数传递给b.jsp,又该怎么写?就像这样:http://localhost:8080/upload/b.jsp?djbh=52524523452.各位指点指点啊,急用。
当然要用Struts转发了!但是最好不用struts的标签开发,那个不稳定,用标准html。
这是忠告
window.open("xxxx.jsp","","height=500,width=611,scrollbars=yes,status=yes");
window.location.href="xxxx.jsp?param="+参数变量;