project_newUpdate.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="project_newBean" class="MyFly.Bean.project_newBean" 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.  project_newBean.setID(Integer.parseInt(index));
  15.  project_newBean.setTitle(title);
  16.  project_newBean.setContent(content);
  17.  project_newBean.setAppendTime(appendTime);
  18.  
  19. if(project_newBean.update() == 1)
  20. {
  21.      out.println("<script language=javascript>location.href='project_newView.jsp';</script>");
  22.  
  23. }
  24. else
  25. {
  26.    out.println("<Script language=JavaScript>alert('修改失败,请重新修改');JavaScript:history.back();</Script>");
  27. }
  28. %>