allen
专注于java ee技术,包括struts,jsf,webwork,spring,hibernate,ibatis
posts - 7,  comments - 9,  trackbacks - 0

index.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<script language="javascript">
function detect(){
  xml=new ActiveXObject("Microsoft.XMLHTTP");
  var post="";
  xml.open("POST","http://localhost:8080/xmlhttp.jsp",false);
  xml.setrequestheader("content-length" ,post.length);
  xml.setrequestheader("content-type" , "application/x-www-form-urlencoded" );
  xml.send(post);
  var res=xml.responseText;
  list.innerText=res;
  setTimeout("detect()",1000);
}
</script>

<body onload = "detect()">
test :
     <a id="list" >  </a>

</BODY>
</HTML>


xmlhttp.jsp
<%@ page language="java" contentType="text/html;charset=GB2312"%>
<%@ page import ="java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<%
  Random randor=new Random();
  out.println(randor.nextInt());
%>
</BODY>
</HTML>

posted on 2006-11-17 12:43 robbin163 阅读(180) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

<2006年11月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

常用链接

留言簿(3)

随笔分类

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜