succeedcaseInsert.jsp
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:2k
源码类别:

Applet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=GB2312"%>
  2. <%@ page import="java.sql.* ,java.util.Date,java.text.SimpleDateFormat"%>
  3. <% request.setCharacterEncoding("GB2312");%>
  4. <jsp:useBean id="succeedcaseBean" class="MyFly.Bean.succeedcaseBean" scope="request"/>
  5. <%
  6.     String topic = request.getParameter("topic");
  7. if (topic == null || topic.equals(""))
  8. {
  9.    out.println("<Script language=JavaScript>alert('标题不能为空');JavaScript:history.back();</Script>");
  10. }
  11.     //topic = new String(topic.getBytes("ISO8859_1"));
  12.     String Content = request.getParameter("content");
  13. if (Content == null)
  14. {
  15.     out.println("<Script language=JavaScript>alert('请添加内容');JavaScript:history.back();</Script>");
  16. }
  17. //Content=new String(Content.getBytes("GBK"));
  18.     String origin = request.getParameter("origin");
  19. if (origin == null || origin.equals(""))
  20. {
  21.     origin = "no";
  22. }
  23. //origin=new String(origin.getBytes("ISO8859_1"));
  24. SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");//将显示"1999-10-1 21:03:10"的格式. 
  25.     Date currentTime_1 = new Date(); 
  26.     String appendTime = formatter.format(currentTime_1); 
  27. succeedcaseBean.setTopic(topic);
  28. succeedcaseBean.setContent(Content);
  29. succeedcaseBean.setOrigin(origin);
  30. succeedcaseBean.setAppendTime(appendTime);
  31. if(succeedcaseBean.addNew() == 1)
  32. {
  33.      out.println("<script language=javascript>location.href='succeedcaseView.jsp';</script>");
  34.  
  35. }
  36. else
  37. {
  38.    out.println("<Script language=JavaScript>alert('添加失败,请重新添加');JavaScript:history.back();</Script>");
  39. }
  40. %>