noticeUpdate.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. <%request.setCharacterEncoding("GB2312");%>
  4. <jsp:useBean id="noticeBean" class="MyFly.Bean.noticeBean" scope="request"/>
  5. <%
  6.     String index=request.getParameter("index");
  7. String content=request.getParameter("content");
  8.     SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");//将显示"1999-10-1 21:03:10"的格式. 
  9.     Date currentTime_1 = new Date(); 
  10.     String appendTime = formatter.format(currentTime_1); 
  11. noticeBean.setNoticeID(Integer.parseInt(index));
  12. noticeBean.setContent(content);
  13. noticeBean.setAppendTime(appendTime);
  14. if(noticeBean.update() == 1)
  15. {
  16.      out.println("<script language=javascript>location.href='noticeView.jsp';</script>");
  17.  
  18. }
  19. else
  20. {
  21.    out.println("<Script language=JavaScript>alert('更新失败,请重新添加');JavaScript:history.back();</Script>");
  22. }
  23. %>