歡迎來到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁(yè) 裝配圖網(wǎng) > 資源分類 > DOC文檔下載  

智能移動(dòng)方向Jsp開發(fā)實(shí)訓(xùn)任務(wù)書及實(shí)訓(xùn)報(bào)告在線考試系統(tǒng)的制作

  • 資源ID:35090840       資源大?。?span id="jxbrlrb" class="font-tahoma">841.50KB        全文頁(yè)數(shù):44頁(yè)
  • 資源格式: DOC        下載積分:10積分
快捷下載 游客一鍵下載
會(huì)員登錄下載
微信登錄下載
三方登錄下載: 微信開放平臺(tái)登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要10積分
郵箱/手機(jī):
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機(jī)號(hào),方便查詢和重復(fù)下載(系統(tǒng)自動(dòng)生成)
支付方式: 支付寶    微信支付   
驗(yàn)證碼:   換一換

 
賬號(hào):
密碼:
驗(yàn)證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會(huì)被瀏覽器默認(rèn)打開,此種情況可以點(diǎn)擊瀏覽器菜單,保存網(wǎng)頁(yè)到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請(qǐng)使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無水印,預(yù)覽文檔經(jīng)過壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒有明確說明有答案則都視為沒有答案,請(qǐng)知曉。

智能移動(dòng)方向Jsp開發(fā)實(shí)訓(xùn)任務(wù)書及實(shí)訓(xùn)報(bào)告在線考試系統(tǒng)的制作

學(xué)校代碼: 10128 學(xué) 號(hào): 201320905047 JSP開發(fā)實(shí)訓(xùn)報(bào)告書題 目:在線考試系統(tǒng)的制作學(xué)生姓名:張志勇學(xué) 院:理學(xué)院班 級(jí):信計(jì)13-1指導(dǎo)教師:李曉瑜、宋健、賴俊峰 二一六年一月一、項(xiàng)目名稱在線考試系統(tǒng)-題庫(kù)子系統(tǒng)二、功能要求 a、用戶管理 b、課程管理 c、題庫(kù)管理 三、需求分析 在線考試系統(tǒng)-題庫(kù)子系統(tǒng)的用戶包括用戶管理員,試題管理員和題庫(kù)使用人員,旨在建立一個(gè)獨(dú)立的題庫(kù)系統(tǒng),為在線考試生成試卷提供支持,包含用戶管理,科目管理,試題管理,生成試卷,試卷分析等內(nèi)容,為用戶提供了一個(gè)快速、全面、準(zhǔn)確的試題管理平臺(tái)。四、設(shè)計(jì)思想 a、使用Java Web技術(shù)實(shí)現(xiàn) b、使用Mysql存儲(chǔ)數(shù)據(jù) c、基于MVC方式實(shí)現(xiàn)用例設(shè)計(jì)思路:(如下圖)分步詳解:第一步:創(chuàng)建項(xiàng)目名(zhangzhiyong);第二步:創(chuàng)建項(xiàng)目所需要的包;第三步:導(dǎo)入需要的工具;第四步:創(chuàng)建數(shù)據(jù)庫(kù)的連接;第五步:需要的準(zhǔn)備工作做好之后,明確先做用戶管理系統(tǒng)(登錄,查看,刪除,修改,增加,退出;);第六步:做好用戶管理之后進(jìn)行科目管理(增加,刪除,修改,查看;);第七步:接下來進(jìn)行知識(shí)點(diǎn)管理(增加,刪除,修改,查看;);五、具體實(shí)現(xiàn)一用戶管理:需要的servlet:(user servlet)package cn.zhangzhiyong.service;import java.io.IOException;import java.io.PrintWriter;import java.util.List;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.User;import cn.zhangzhiyong.dao.UserDAO;import cn.zhangzhiyong.util.RequestUtil;WebServlet("/UserServlet")public class UserServlet extends HttpServlet private static final long serialVersionUID = 1L; public UserServlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=utf-8");PrintWriter out=response.getWriter();String type=request.getParameter("type");String userLogname=request.getParameter("userLogname");String userPwd=request.getParameter("userPwd");UserDAO dao=new UserDAO();User user=dao.login(userLogname, userPwd);if("login".equals(type)if(user!=null)request.getSession().setAttribute("SESSION_USER",user);response.sendRedirect("res/index.html");elseout.print("<script type=text/javascript>");out.print("alert(用戶名或密碼錯(cuò)誤,請(qǐng)重新輸入!);");out.print("window.location=login.jsp;");out.print("</script>");else if("logout".equals(type)request.getSession().invalidate();out.print("<script type=text/javascript>");out.print("window.location=login.jsp;");out.print("</script>");else if("list".equals(type)List<User> list=dao.selectAll();request.setAttribute("list",list);request.getRequestDispatcher("res/user.jsp").forward(request, response);protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException doGet(request, response);(user add servlet)package cn.zhangzhiyong.service;import java.io.IOException;import java.io.PrintWriter;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.User;import cn.zhangzhiyong.dao.UserDAO;import cn.zhangzhiyong.util.RequestUtil;WebServlet("/UserAddServlet")public class UserAddServlet extends HttpServlet private static final long serialVersionUID = 1L; public UserAddServlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("utf-8");String login=request.getParameter("login");String name=request.getParameter("name");int type=(request.getParameter("type")=null)?3:Integer.parseInt(request.getParameter("type");int status=(request.getParameter("status")=null)?1:Integer.parseInt(request.getParameter("status");User user=new User(login,name,type,status);UserDAO dao=new UserDAO();int n=dao.save(user);if(n=1)response.sendRedirect("UserServlet?type=list");elseresponse.sendRedirect("index.jsp");protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException doGet(request, response);(UserDeleteServlet)package cn.zhangzhiyong.service;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.User;import cn.zhangzhiyong.dao.UserDAO;import cn.zhangzhiyong.util.RequestUtil;import cn.zhangzhiyong.util.WebUtil;WebServlet("/UserDeleteServlet")public class UserDeleteServlet extends HttpServlet private static final long serialVersionUID = 1L; public UserDeleteServlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("UTF-8");/ System.out.println(request.getParameter("Id"); int id=RequestUtil.getInt(request,"Id"); UserDAO dao=new UserDAO(); dao.delete(id); WebUtil.forward(request, response, "UserServlet?type=list"); protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException / TODO Auto-generated method stubdoGet(request, response);(UserUpdate1Servlet)package cn.zhangzhiyong.service;import java.io.File;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.Part;import cn.zhangzhiyong.bean.User;import cn.zhangzhiyong.dao.UserDAO;import cn.zhangzhiyong.util.RequestUtil;import cn.zhangzhiyong.util.WebUtil;WebServlet("/UserUpdate1Servlet")public class UserUpdate1Servlet extends HttpServlet private static final long serialVersionUID = 1L; public UserUpdate1Servlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=utf-8");int id=RequestUtil.getInt(request,"Id"); request.setAttribute("id", id); request.getRequestDispatcher("res/user-update.jsp").forward(request, response); protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException / TODO Auto-generated method stubdoGet(request, response);(UserUpdateServlet)package cn.zhangzhiyong.service;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.User;import cn.zhangzhiyong.dao.UserDAO;import cn.zhangzhiyong.util.RequestUtil;WebServlet("/UserUpdateServlet")public class UserUpdateServlet extends HttpServlet private static final long serialVersionUID = 1L; public UserUpdateServlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("utf-8");String login=request.getParameter("login");String name=request.getParameter("name");String passwd=request.getParameter("passwd");int type=Integer.parseInt(request.getParameter("type");int status=Integer.parseInt(request.getParameter("status");int id=RequestUtil.getInt(request,"id");User users=new User(login,name,type,status);UserDAO dao=new UserDAO();int n=dao.update(users);if(n=1)response.sendRedirect("UserServlet?type=list");elseresponse.sendRedirect("index.jsp");protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException doGet(request, response);(UserViewServlet)package cn.zhangzhiyong.service;import java.io.IOException;import java.io.PrintWriter;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.User;import cn.zhangzhiyong.dao.UserDAO;import cn.zhangzhiyong.util.RequestUtil;WebServlet("/UserViewServlet")public class UserViewServlet extends HttpServlet private static final long serialVersionUID = 1L; public UserViewServlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=utf-8");PrintWriter out=response.getWriter();String type=request.getParameter("type");String userLogname=request.getParameter("userLogname");String userPwd=request.getParameter("userPwd");UserDAO dao=new UserDAO();int id=RequestUtil.getInt(request,"Id");User user1=dao.selectById(id);request.setAttribute("user",user1);request.getRequestDispatcher("res/user-show.jsp").forward(request, response);protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException doGet(request, response);需要的類:package cn.zhangzhiyong.bean;import java.sql.Timestamp;public class User public static final String passwd="123456"private int id;private String login;private String name;private String password;private int type;private int status;private Timestamp last_login; public User(String login2, String name2, int type2, int status2) super();this.login=login2;this.name=name2;this.type=type2;this.status=status2;public User() public User(int id2) this.id=id2;public int getId() return id;public void setId(int id) this.id = id;public String getLogin() return login;public void setLogin(String login) this.login = login;public String getName() return name;public void setName(String name) this.name = name;public String getPassword() return password;public void setPassword(String password) this.password = password;public int getType() return type;public void setType(int type) this.type = type;public int getStatus() return status;public void setStatus(int status) this.status = status;public Timestamp getLast_login() return last_login;public void setLast_login(Timestamp last_login) this.last_login = last_login;需要的dao:package cn.zhangzhiyong.dao;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.util.ArrayList;import java.util.List;import cn.zhangzhiyong.bean.User;import cn.zhangzhiyong.util.DBUtil;public class UserDAO /userdao中的save方法public int save(User user)int n=-1;Connection conn=DBUtil.getConnection();/連接對(duì)象PreparedStatement pstmt=null;/語句對(duì)象/下邊是s語句String sql="insert into userss"+" values(DL_USERSS.NEXTVAL,?,?,123456,?,?,sysdate)"trypstmt=conn.prepareStatement(sql);pstmt.setString(1, user.getLogin();pstmt.setString(2, user.getName();pstmt.setInt(3, user.getType();pstmt.setInt(4, user.getStatus();n=pstmt.executeUpdate();/n=更新的行數(shù)catch(SQLException e)e.printStackTrace();finallyDBUtil.closeJDBC(null, pstmt, conn);return n;public User login(String userLogname, String userPwd) Connection conn=DBUtil.getConnection();PreparedStatement pstmt=null;ResultSet rs=null;User u=null;String sql="select id,login,name,passwd,type,status,last_login"+ " from users where login=? and passwd=?"trypstmt=conn.prepareStatement(sql);pstmt.setString(1, userLogname);pstmt.setString(2, userPwd);rs=pstmt.executeQuery();if(rs.next()u=new User();u.setId(rs.getInt(1);u.setLogin(rs.getString(2);u.setName(rs.getString(3);u.setPassword(rs.getString(4);u.setType(rs.getInt(5);u.setStatus(rs.getInt(6);u.setLast_login(rs.getTimestamp(7);catch(SQLException e)e.printStackTrace();finallyDBUtil.closeJDBC(rs, pstmt, conn);return u;public User selectById(int Id) User user=new User();Connection conn=DBUtil.getConnection();PreparedStatement pstmt=null;ResultSet rs=null;String sql="select * from userss where id=?"trypstmt=conn.prepareStatement(sql);pstmt.setInt(1, Id);rs=pstmt.executeQuery();if(rs.next()user.setId(rs.getInt(1);user.setLogin(rs.getString(2);user.setName(rs.getString(3);user.setPassword(rs.getString(4);user.setType(rs.getInt(5);user.setStatus(rs.getInt(6);catch(SQLException e)e.printStackTrace();finallyDBUtil.closeJDBC(rs, pstmt, conn);return user;public List<User> selectAll()List<User> list=new ArrayList<User>();Connection conn=DBUtil.getConnection();PreparedStatement pstmt=null;ResultSet rs=null;String sql="select * from userss order by id desc"trypstmt=conn.prepareStatement(sql);rs=pstmt.executeQuery();while(rs.next()User user=new User();user.setId(rs.getInt(1);user.setLogin(rs.getString(2);user.setName(rs.getString(3);user.setPassword(rs.getString(4);user.setType(rs.getInt(5);user.setStatus(rs.getInt(6);list.add(user);catch(SQLException e)e.printStackTrace();finallyDBUtil.closeJDBC(rs, pstmt, conn);return list;/userdao中的update方法public int update(User users)int n=-1;Connection conn=DBUtil.getConnection();/連接對(duì)象PreparedStatement pstmt=null;/語句對(duì)象String sql="update userss" + " set login=?,name=?,passwd=123,type=?,status=? where id=?"trypstmt=conn.prepareStatement(sql);pstmt.setString(1, users.getLogin();pstmt.setString(2, users.getName();pstmt.setInt(3, users.getType();pstmt.setInt(4, users.getStatus();pstmt.setInt(5,users.getId();n=pstmt.executeUpdate();/n=更新的行數(shù)catch(SQLException e)e.printStackTrace();finallyDBUtil.closeJDBC(null, pstmt, conn);return n;/userdao中的delete 方法public int delete(int id)int m=-1;Connection conn=DBUtil.getConnection();/連接對(duì)象PreparedStatement pstmt=null;/語句對(duì)象String sql="delete from userss where id=?"trypstmt=conn.prepareStatement(sql);pstmt.setInt(1,id);m=pstmt.executeUpdate();/n=更新的行數(shù)catch(SQLException e)e.printStackTrace();finallyDBUtil.closeJDBC(null, pstmt, conn);return m;二科目管理:需要的servlet:(SubjectViewServlet)package cn.zhangzhiyong.service;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.Subject;import cn.zhangzhiyong.dao.SubjectDAO;import cn.zhangzhiyong.util.RequestUtil;/* * Servlet implementation class SubjectViewServlet */WebServlet("/SubjectViewServlet")public class SubjectViewServlet extends HttpServlet private static final long serialVersionUID = 1L; public SubjectViewServlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=utf-8");SubjectDAO dao=new SubjectDAO();int id=RequestUtil.getInt(request,"id");Subject subject=dao.selectById(id);request.setAttribute("Subject",subject);request.getRequestDispatcher("res/subject-show.jsp").forward(request, response);protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException doGet(request, response);(SubjectUpdate2Servlet)package cn.zhangzhiyong.service;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.Subject;import cn.zhangzhiyong.dao.SubjectDAO;import cn.zhangzhiyong.util.RequestUtil;WebServlet("/SubjectUpdate2Servlet")public class SubjectUpdate2Servlet extends HttpServlet private static final long serialVersionUID = 1L; public SubjectUpdate2Servlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException Subject subject =new Subject();subject.setKname(RequestUtil.getString(request, "kname");subject.setType(RequestUtil.getInt(request, "type");subject.setKint(RequestUtil.getString(request, "kint");subject.setId(RequestUtil.getInt(request, "id");SubjectDAO dao=new SubjectDAO();int n=dao.update(subject);response.sendRedirect("ServletListServlet?type=list");protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException doGet(request, response);(SubjectUpdate0Servlet)package cn.zhangzhiyong.service;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.bean.Subject;import cn.zhangzhiyong.dao.SubjectDAO;import cn.zhangzhiyong.util.RequestUtil;/* * Servlet implementation class SubjectUpdate0Servlet */WebServlet("/SubjectUpdate0Servlet")public class SubjectUpdate0Servlet extends HttpServlet private static final long serialVersionUID = 1L; public SubjectUpdate0Servlet() super(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=utf-8");SubjectDAO dao=new SubjectDAO();int id=RequestUtil.getInt(request,"id");Subject subject=dao.selectById(id);request.setAttribute("Subject",subject);request.getRequestDispatcher("res/subject-update.jsp").forward(request, response);protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException doGet(request, response);(SubjectListServlet)package cn.zhangzhiyong.service;import java.io.IOException;import java.util.List;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import cn.zhangzhiyong.dao.SubjectDAO;import cn.zhangzhiyong.bea

注意事項(xiàng)

本文(智能移動(dòng)方向Jsp開發(fā)實(shí)訓(xùn)任務(wù)書及實(shí)訓(xùn)報(bào)告在線考試系統(tǒng)的制作)為本站會(huì)員(仙***)主動(dòng)上傳,裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng)(點(diǎn)擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因?yàn)榫W(wǎng)速或其他原因下載失敗請(qǐng)重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!