addsucess_chare.jsp
资源名称:shop.rar [点击查看]
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:2k
源码类别:
Applet
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
- <jsp:useBean id="sharesortBean" class="MyFly.Bean.sharesortBean" scope="request"/>
- <jsp:useBean id="sharesubstanceBean" class="MyFly.Bean.sharesubstanceBean" scope="request"/>
- <jsp:useBean id="sharesortBeans" class="MyFly.Bean.sharesortBeans" scope="request"/>
- <%@ page import="java.sql.* ,java.util.Date,java.text.SimpleDateFormat"%>
- <%
- request.setCharacterEncoding("GB2312");
- %>
- <%
- String type=request.getParameter("type");
- 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);
- String name=(String)session.getAttribute("name");
- if(name == null)
- {
- out.println("<Script language=JavaScript>alert('请登陆后再发贴吧!');location.href='../index.jsp';</Script>");
- }
- else
- {
- if(title == null || title.equals("") || title == "")
- {
- out.println("<Script language=JavaScript>alert('请填写标题');JavaScript:history.back();</Script>");
- }
- if(content == null || content.equals("") || content == "")
- {
- out.println("<Script language=JavaScript>alert('请填写内容');JavaScript:history.back();</Script>");
- }
- sharesubstanceBean.setSucceedFxID(Integer.parseInt(type));
- sharesubstanceBean.setName(name);
- sharesubstanceBean.setTitle(title);
- sharesubstanceBean.setContent(content);
- sharesubstanceBean.setAppendTime(appendTime);
- sharesubstanceBean.addNew();
- response.sendRedirect("success_share.jsp");
- }
- %>