【正文】
servlet. br * This method is called when a form has its tag value method equals to post. * param request the request send by the client to the server * param response the response send by the server to the client * throws ServletException if an error occurred * throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } /* * Initialization of the servlet. br * throws ServletException if an error occurs */ public void init() throws ServletException { // Put your code here } public void service(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{ (UTF8)。public class ChatServlet extends HttpServlet { /* Constructor of the object.*/ public ChatServlet() { super()。import 。import 。import 。import 。import 。import 。import 。 return true。 } private boolean saveUserList()throws IOException { if (userList == null) { return false。 (new FileInputStream(f))。 if (!()) () 。 } chatMsg .add(user + 說: + msg)。 }