health_centerInsert.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="health_centerBean" class="MyFly.Bean.health_centerBean" scope="request"/>
- <%@ page import="java.util.Date,java.text.SimpleDateFormat"%>
- <% request.setCharacterEncoding("GB2312");%>
- <%
- String title=request.getParameter("title");
- if (title == null || title.equals(""))
- {
- out.println("<Script language=JavaScript>alert('标题不能为空');JavaScript:history.back();</Script>");
- }
- //title = new String(title.getBytes("ISO8859_1"));
- String Content = request.getParameter("content");
- if (Content == null)
- {
- out.println("<Script language=JavaScript>alert('请添加内容');JavaScript:history.back();</Script>");
- }
- //Content=new String(Content.getBytes("ISO8859_1"));
- SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");//将显示"1999-10-1 21:03:10"的格式.
- Date currentTime_1 = new Date();
- String appendTime = formatter.format(currentTime_1);
- health_centerBean.setTitle(title);
- health_centerBean.setContent(Content);
- health_centerBean.setAppendTime(appendTime);
- if(health_centerBean.addNew() == 1)
- {
- out.println("<script language=javascript>location.href='health_centerView.jsp';</script>");
- }
- else
- {
- out.println("<Script language=JavaScript>alert('添加失败,请重新修改');JavaScript:history.back();</Script>");
- }
- %>