日期:2014-05-17 浏览次数:20757 次
<%@ page language="java" contentType="text/html; charset=utf-8" import="sjw.pratice.TransferInfo"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>聊天室</title>
</head>
<script type="text/javascript">
var info=Record;
var f=document.getElementById("form1");
f.textbox1.value=info;
</script>
<body>
<form id="form1" name="form1" method="post" action="ReceiveInfo">
<table width=888 height="466" border="3" cellpadding="3" cellspacing="3">
<tr align="center">
<td height=375 colspan="2"><textarea name="textbox1" cols="103" rows="28" readonly="readonly" id="textbox1"></textarea></td>
<td width=151 rowspan="2"><textarea name="textbox3" cols="15" rows="40" readonly="readonly" id="textbox3"></textarea></textarea></td>
</tr>
<tr>
<td width=656 height="76"><textarea name="textbox2" id="textbox2" cols="90" rows="5"></textarea></td>
<td width=71 align="center"><input type="submit" name="button1" id="button1" value="发送" /></td>
</tr>
</table>
</form>
<%!String Record=TransferInfo.getchattingRecord(); %>
</body>
</html>
package sjw.pratice;
import java.io.IOException;
import java.util.Calendar;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
@WebServlet("/ReceiveInfo")
public class ReceiveInfo extends HttpServlet {
private static final long serialVersionUID = 1L;
public ReceiveInfo() {
super();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String record=new String();
ServletContext application=super.getServletContext();
Calendar date=Calendar.getInstance();