noticeUpdate.jsp
资源名称:shop.rar [点击查看]
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:1k
源码类别:
Applet
开发平台:
Java
- <%@ page contentType="text/html;charset=GB2312"%>
- <%@ page import="java.sql.* ,java.util.Date,java.text.SimpleDateFormat"%>
- <%request.setCharacterEncoding("GB2312");%>
- <jsp:useBean id="noticeBean" class="MyFly.Bean.noticeBean" scope="request"/>
- <%
- String index=request.getParameter("index");
- 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);
- noticeBean.setNoticeID(Integer.parseInt(index));
- noticeBean.setContent(content);
- noticeBean.setAppendTime(appendTime);
- if(noticeBean.update() == 1)
- {
- out.println("<script language=javascript>location.href='noticeView.jsp';</script>");
- }
- else
- {
- out.println("<Script language=JavaScript>alert('更新失败,请重新添加');JavaScript:history.back();</Script>");
- }
- %>