notieInsert.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 Content = request.getParameter("content");
  7. if (Content == null)
  8. {
  9.     out.println("<Script language=JavaScript>alert('请添加内容');JavaScript:history.back();</Script>");
  10. }
  11. //Content=new String(Content.getBytes("ISO8859_1"));
  12. noticeBean.setContent(Content);
  13. SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");//将显示"1999-10-1 21:03:10"的格式. 
  14.     Date currentTime_1 = new Date(); 
  15.     String appendTime = formatter.format(currentTime_1); 
  16. noticeBean.setAppendTime(appendTime);
  17. if(noticeBean.addNew() == 1)
  18. {
  19.      out.println("<script language=javascript>location.href='noticeView.jsp';</script>");
  20. }
  21. else
  22. {
  23.    out.println("<Script language=JavaScript>alert('添加失败,请重新添加');JavaScript:history.back();</Script>");
  24. }
  25. %>