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

Applet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <jsp:useBean id="cao_benBean" class="MyFly.Bean.cao_benBean" scope="request"/>
  3. <%@ page import="java.util.Date,java.text.SimpleDateFormat"%>
  4. <%request.setCharacterEncoding("GB2312");%>
  5. <%
  6.      String index=request.getParameter("index");
  7.  
  8.      String title=request.getParameter("title");
  9.  String content=request.getParameter("content");
  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.  
  14.  cao_benBean.setCaoID(Integer.parseInt(index));
  15.  cao_benBean.setTitle(title);
  16.  cao_benBean.setContent(content);
  17.  cao_benBean.setAppendTime(appendTime);
  18.  
  19. if(cao_benBean.update() == 1)
  20. {
  21.      out.println("<script language=javascript>location.href='cao_benView.jsp';</script>");
  22.  
  23. }
  24. else
  25. {
  26.    out.println("<Script language=JavaScript>alert('修改失败,请重新修改');JavaScript:history.back();</Script>");
  27. }
  28. %>