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

Applet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=GB2312"%>
  2. <%@ page import="java.sql.*"%>
  3. <% request.setCharacterEncoding("GB2312");%>
  4. <jsp:useBean id="characterclassBean" class="MyFly.Bean.characterclassBean" scope="request"/>
  5. <body bgcolor="#799ae1">
  6. <%
  7. String name=request.getParameter("name");
  8. String content=request.getParameter("content");
  9. if(name == "" || content == "")
  10. {
  11.     out.println("<Script language=JavaScript>alert('请输入正确信息');javascript:history.back();</Script>");
  12.  }
  13.  else
  14.  {
  15.     characterclassBean.setCharacterName(name);
  16. characterclassBean.setCharacterInfo(content);
  17. if(characterclassBean.addNew() == 0)
  18. {
  19.    out.println("<Script language=JavaScript>alert('添加出错');javascript:history.back();</Script>");
  20. }
  21. else
  22.     {
  23.     response.sendRedirect("characterclassView.jsp");
  24.     }
  25.   }
  26. %>
  27. </body>