一个不可理解的问题
一个jsp页面里包含三个iframe:
<%@ page contentType="text/html; charset=GBK" %>
<%@ isthreadsafe="true" %>
<html>
<head>
<title>聊天室</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
</head>
<%
String roomId = request.getParameter("roomId");
%>
<body onunload="javascript:window.open('closeChat.jsp?roomId=<%=roomId%>','_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=50,height=50');">
<table border="0" cellspacing="0" cellpadding="0" >
<tr>
<td rowspan="2">
<iframe src="userList.jsp?roomId=<%=roomId%>" style="height:672;width:200;"frameBorder="1" scrolling=auto>
</iframe>
</td>
<td>
<iframe src="showMessage.jsp?roomId=<%=roomId%>" style="height:522;width:806;"frameBorder="1" scrolling=auto>
</iframe>
</td>
</tr>
<tr>
<td>
<iframe src="sendMessage.jsp?roomId=<%=roomId%>" style="height:150;width:806;"frameBorder="1" scrolling=no>
</iframe>
</td>
</tr>
</table>
</body>
</html>
在sendMessage.jsp中
String roomId = (String)request.getParameter("roomId");
System.out.println("sendMessage--------------roomId:" + roomId);
getParameter时不为null.
System.out.println有时候roomId为null 为什么啊? 难道roomId不能保持它的值吗?