<%@ page contentType="text/html; charset=GB2312" language="java" import="java.util.*" import="java.sql.*" %>
<html>
<head><title>n</title>
<script language="javascript">
function func()
{
xml = new ActiveXObject("Microsoft.XMLHTTP");
var post="<input type='text' name='name' value='1value'/>";//构造要携带的数据
xml.open("POST","xmlhttp.jsp",false);//使用POST方法打开一个到服务器的连接,以异步方式通信
xml.setrequestheader("content-length",post.length);
xml.setrequestheader("content-type","application/x-www-form-urlencoded");
xml.send(post);//发送数据
//返回结果
var v = xml.responseText;
//处理这个结果
document.write( '结果:' + v );
}
</script>
</head>
<body onLoad="func()">
<%
out.println("abcd");
java.io.BufferedReader br = request.getReader();
String str = "";
String srt=br.readLine();
while(srt!=null)
{
str += srt+"/n";
srt=br.readLine();
}
out.println(str);
%>
</body>
</html>