useclassInsert.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="useclassBean" class="MyFly.Bean.useclassBean" scope="request"/>
  5. <%
  6. String name=request.getParameter("name");
  7. String content=request.getParameter("content");
  8. String charactor=request.getParameter("characterID");
  9. if(name == "" || content == ""||charactor.equals("all"))
  10. {
  11.     out.println("<Script language=JavaScript>alert('请输入正确信息');javascript:history.back();</Script>");
  12. }
  13.  else
  14.  {
  15.     useclassBean.setUseclassName(name);
  16. useclassBean.setUseclassInfo(content);
  17. useclassBean.setUseclasscharacterID(Integer.parseInt(charactor));
  18. //System.out.print(charactor);
  19. if(useclassBean.addNew() == 0)
  20. {
  21.    out.println("<Script language=JavaScript>alert('添加出错');javascript:history.back();</Script>");
  22. }
  23. else
  24.     {
  25.     response.sendRedirect("useclassView.jsp");
  26.     }
  27.   }
  28. %>