messageboardHuifu.jsp
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:1k
源码类别:

Applet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GB2312"%>
  2. <%@ page import="java.sql.* ,java.util.Date,java.text.SimpleDateFormat"%>
  3. <%
  4.   request.setCharacterEncoding("GB2312");
  5. %>
  6. <jsp:useBean id="messageboardBean" class="MyFly.Bean.messageboardBean" scope="request"/>
  7. <%
  8. String huifu=request.getParameter("huifu");
  9. String index=request.getParameter("index");
  10. SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");//将显示"1999-10-1 21:03:10"的格式. 
  11.     Date currentTime_1 = new Date(); 
  12.     String appendTime = formatter.format(currentTime_1); 
  13. messageboardBean.setMessageboardID(Integer.parseInt(index));
  14. messageboardBean.setHuifu(huifu);
  15. messageboardBean.setHuifutime(appendTime);
  16. messageboardBean.setIsHuifu("yes");
  17. if(messageboardBean.update() == 1)
  18. {
  19.      out.println("<script language=javascript>location.href='messageboardView.jsp';</script>");
  20.  
  21. }
  22. else
  23. {
  24.    out.println("<Script language=JavaScript>alert('回复失败,请重新添加');JavaScript:history.back();</Script>");
  25. }
  26. %>