cao_benUpdate.jsp
资源名称:shop.rar [点击查看]
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:1k
源码类别:
Applet
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
- <jsp:useBean id="cao_benBean" class="MyFly.Bean.cao_benBean" scope="request"/>
- <%@ page import="java.util.Date,java.text.SimpleDateFormat"%>
- <%request.setCharacterEncoding("GB2312");%>
- <%
- String index=request.getParameter("index");
- String title=request.getParameter("title");
- String content=request.getParameter("content");
- SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");//将显示"1999-10-1 21:03:10"的格式.
- Date currentTime_1 = new Date();
- String appendTime = formatter.format(currentTime_1);
- cao_benBean.setCaoID(Integer.parseInt(index));
- cao_benBean.setTitle(title);
- cao_benBean.setContent(content);
- cao_benBean.setAppendTime(appendTime);
- if(cao_benBean.update() == 1)
- {
- out.println("<script language=javascript>location.href='cao_benView.jsp';</script>");
- }
- else
- {
- out.println("<Script language=JavaScript>alert('修改失败,请重新修改');JavaScript:history.back();</Script>");
- }
- %>