chatroom.jsp<html><head>
<script language="javascript">function ajax()
{
var a=document.chatroom.msg.value;
var xmlHttp=null;
var url="sendmsg.jsp?msg="+a;
xmlHttp=new XMLHttpRequest();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=handleResponse;
xmlHttp.send(null);
}function handleResponse()
  {
  if (xmlHttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("here").innerHTML=xmlHttp.responseText;
    }
  }</script>
</head><body>
<form name=chatroom><textarea  name=chamsg rows=20 cols=50>
</textarea>
<div id="here">
</div><input type=text name=msg >
<input type=button onclick="ajax()" value=send>
</form>
</body></html>
sendmsg.jsp
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<%@ page import="com.channelsoft.ivrmonitor.model.AlertEvent"%>
<%@ page import="com.channelsoft.ivrmonitor.model.config.AlertManager"%>
<%@ page import="com.channelsoft.ivrmonitor.model.SystemModelFactory"%>
<html>
<head>
<body>
<% response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
String ID=(String)session.getAttribute("userid");
String A=(String)application.getAttribute("ALLMSG");
String MSG=A+ID+" : "+request.getParameter("msg")+"\r\n";
application.setAttribute("ALLMSG",MSG);
out.print(ALLMSG);
%>
</body>
</html>
为何运行会失败 仿佛sendmsg这个文件根本没有执行!