资 源 简 介
<% request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); String name=request.getParameter("username"); String liuyan=request.getParameter("liuyan"); if(name.equals("")){ out.print(""); }else{ Message msg=new Message(); msg.setUsername(name); msg.setLiuyan(liuyan); //从application获取所有的留言,采用List格式保存留言 List list=(List) application.getAttribute("msgs"); //最开始的时候,创建一个新的List对象 if(list==null){ list=new ArrayList(); //保存在application里 application.setAttribute("msgs", list); } list.add(msg); //展示所有留言数据 InetAddress addr=InetAddress.getLocalHost(); String ip=addr.getHostAddress().toString(); for(Message m