举例
#a.jsp:
<form action="b.jsp" method="post">
<input type="text" name="username" >
<input type="text" name="password" >
</form>#b.jsp
<%=request.getParameter("username")%>
<%=request.getParameter("password")%>request.getParameter一般只接受post和get方法传过来的值
^^
图片和flash是不能传的
#a.jsp:
<form action="b.jsp" method="post">
<input type="text" name="username" >
<input type="text" name="password" >
</form>#b.jsp
<%=request.getParameter("username")%>
<%=request.getParameter("password")%>request.getParameter一般只接受post和get方法传过来的值
^^
图片和flash是不能传的
如果你从库里读出一个id,并传给下一个页面.
id=rs.getInt("id");//设id是一个类型为int的数据库字段.a.jsp
<a href="b.jsp?id=<%=id%>">在b.jsp中,就可以用
request.getParameter("id");来得到这个传递过来的参数.
比如 xxx.jsp?id=xxx
得到的是xxx
或者input name=id value=xxx
submit 的时候xxx就传过去了
例如:当鼠标放在图片或flash上时,鼠标变小手,点下去就连到subject.jsp?id=1或subject.jsp?id=2
的页面上了,我想问他是怎么使图片或flash成为1或2的,难道是随机的,按他们的排列顺序,我不信,
可是我在程序里找不到设置图片或flash的代码,这到底是为什么?
<%@ page contentType="text/html;charset=gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>项目信息</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<LINK href="css/text.css" rel=stylesheet>
<body background="IMAGES/i_bac_9.jpg">
<table width="1006" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="90" height="24"><div id="Layer1" style="position:absolute; width:181px; height:90px; z-index:1; left: 188px; top: 90px;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="180" height="90">
<param name="wmode" value="transparent">
<param name="movie" value="FLASH/NTS.swf">
<param name="quality" value="high">
<embed src="FLASH/NTS.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="90"></embed></object>
</div>
</td>
<td width="817"> </td>
<td width="99"> </td>
</tr>
<tr>
<td height="722"> </td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="171" colspan="2" valign="top" background="IMAGES/i_bac_15.jpg"><!--DWLayoutEmptyCell--> </td>
<td width="25" rowspan="2" valign="bottom" background="IMAGES/i_bac_17.jpg">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="IMAGES/i_bac_7.jpg" height="659" >
<!--DWLayoutTable-->
<tr>
<td width="25" height="659" valign="bottom"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15" height="525" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="IMAGES/i_bac_16.jpg">
<!--DWLayoutTable-->
<tr>
<td width="15" height="525"> </td>
</tr>
</table></td>
<td width="777" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!--DWLayoutTable-->
<tr>
<td width="777" height="50" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="777" height="50">
<param name="movie" value="FLASH/in_lef_2.swf">
<param name="quality" value="high">
<param name="SCALE" value="exactfit">
<embed src="FLASH/in_lef_2.swf" width="777" height="50" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="exactfit"></embed></object></td>
</tr>
<tr>
<td height="6"></td>
</tr>
<tr>
<td height="462" align="center" valign="top" bgcolor="#FFFFFF">
<%
String isid = request.getParameter("id");
if(isid==null){
%>
<jsp:include page="subject/query.htm"/>
<%
}else{
int id=Integer.parseInt(isid);
if(id == 1){
%>
<jsp:include page="subject/i_forge1.jsp"/>
<%
}else if(id == 2){
%>
<jsp:include page="subject/i_award1.jsp"/>
<%
}
}
%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="26" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="IMAGES/i_bac_8.jpg">
<!--DWLayoutTable-->
<tr>
<td width="817" height="26"> </td>
</tr>
</table></td>
</tr>
</table></td>
<td> </td>
</tr>
<tr>
<td height="8"> </td>
<td height="8"> </td>
<td height="8"> </td>
</tr>
<tr>
<td height="13"></td>
<td align="center" valign="middle"><p><font color="#202020" size="2"><strong>©2002-2003
版权所有</strong></font></p></td>
<td></td>
</tr></table>
</body>
</html>