一个不可理解的问题

flyingsun 2004-04-29 01:24:09
一个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不能保持它的值吗?
...全文
18 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
joy19 2004-04-29
  • 打赏
  • 举报
回复
你能说明白一点它在什么地方为空?
Arias 2004-04-29
  • 打赏
  • 举报
回复
肯定是你自己取值的问题那!
怎么可能出现这些问题呢!只要你前一个页面能真正的把需要的值传递过去了
那么本页面就一定能取得你的值,折实根据你传递的方式决定的。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧