addliouyan.jsp
资源名称:shop.rar [点击查看]
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:2k
源码类别:
Applet
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
- <%@ page import="java.util.Date,java.text.SimpleDateFormat"%>
- <jsp:useBean id="messageboardBean" class="MyFly.Bean.messageboardBean" scope="request"/>
- <%
- request.setCharacterEncoding("gb2312");
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>无标题文档</title>
- </head>
- <body>
- <%
- String name=request.getParameter("name");
- if(name == null)
- {
- name="";
- }
- String mailbox=request.getParameter("mailbox");
- if(mailbox == null)
- {
- mailbox="";
- }
- String telephone=request.getParameter("face");//头像
- String qq=request.getParameter("qq");
- if(qq == null)
- {
- qq="";
- }
- String title=request.getParameter("title");
- if(title == null)
- {
- title="";
- }
- String content=request.getParameter("content");
- if(content == null)
- {
- 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);
- messageboardBean.setName(name);
- messageboardBean.setMailbox(mailbox);
- messageboardBean.setTelephone(face);
- messageboardBean.setQq(qq);
- messageboardBean.setTitle(title);
- messageboardBean.setContent(content);
- messageboardBean.setHuifu("");
- messageboardBean.setTime(appendTime);
- messageboardBean.setHuifutime(appendTime);
- messageboardBean.setIsHuifu("no");
- if(messageboardBean.addNew() == 1)
- {
- out.println("<script language=javascript>location.href='liuyan.jsp';</script>");
- }
- else
- {
- out.println("<Script language=JavaScript>alert('添加失败,请重新添加');JavaScript:history.back();</Script>");
- }
- %>
- </body>
- </html>