⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subjectmanage.jsp

📁 题库管理系统,用最新的jsp技术开发的,里面有一些比较好的方法,希望与大家共享
💻 JSP
字号:
<%@page contentType="text/html"%><%@page pageEncoding="GB2312"%><%@page import="TiKuMS.*"%><%@include file="checkMaster.jsp"%><%   String errorMsg="";   String sql="";   int subjectID;   DataConnection dataConn=new DataConnection();   if(request.getParameter("subjectID")!=null)   {       sql="delete from subject where subjectID="+request.getParameter("subjectID");       dataConn.excute(sql);       errorMsg="";   }   if(request.getParameter("name")!=null)   {       sql="select * from subject where name='"+request.getParameter("name")+"'";       dataConn.excuteQuery(sql);       if(dataConn.getRs().next())       {           errorMsg="增加科目失败,该科目已经存在!";       }       else       {           sql="insert into subject(name,note) value('"+request.getParameter("name")+"','"+request.getParameter("note")+"')";            dataConn.excute(sql);            errorMsg="增加科目成功!";       }   }%><!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>        <table border="0" align="center">                <tr>                    <td><%@include file="header.jsp"%></td>                </tr>                <tr>                    <td>                        <table border="0" cellspacing="2">                                <tr>                                    <td valign="top">                                       <fieldset>                                           科目列表                                           <table border="1" width="100%">                                               <thead>                                                   <tr>                                                       <th>ID</th>                                                       <th>科目名称</th>                                                       <th>题量</th>                                                       <th>操作</th>                                                   </tr>                                               </thead>                                               <tbody><%       sql="select subjectID,name,questionNum from subject";       dataConn.excuteQuery(sql);       while(dataConn.getRs().next())       {           subjectID=dataConn.getRs().getInt("subjectID");%>                                                   <tr>                                                       <td><%=subjectID%></td>                                                       <td><%=Tools.toChinese(dataConn.getRs().getString("name"))%></td>                                                       <td><%=dataConn.getRs().getString("questionNum")%></td>                                                       <td>                                                           <a href="subjectManage.jsp?subjectID=<%=subjectID%>">删除</a>                                                       </td>                                                   </tr><%       }%>                                               </tbody>                                           </table>                                       </fieldset>                                                                       </td>                                    <td valign="top">                                       <fieldset>                                           增加科目                                        <div align="center"><font color="#ff0000"><%=errorMsg%></font></div>                                        <form name="addSubjectForm" method="POST">                                           <div>                                               <ul>                                                   <li>                                                       名称:<input type="text" name="name" />                                                   </li>                                                   <li>                                                       简介:<br/>                                                       <textarea name="note" rows="10" cols="25"></textarea>                                                   </li>                                                   <li>                                                       <input type="submit" value="增加" />                                                   </li>                                               </ul>                                           </div>                                           </form>                                        </fieldset>                                                                        </td>                                </tr>                        </table>                    </td>                </tr>                <tr>                    <td><%@include file="footer.jsp"%></td>                </tr>        </table>    </body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -