資源簡介
Java學生選課成績管理系統,含有B/S模式和C/S模式,學生端使用B/S模式,教師端使用C/S模式,C/S使用swing,mysql數據庫+tomcat,含有數據庫,直接導入就行

代碼片段和文件信息
package?action;
import?java.util.List;
import?handler.ElectiveHandler;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;
import?javax.servlet.http.HttpSession;
import?org.apache.struts.action.ActionForm;
import?org.apache.struts.action.ActionForward;
import?org.apache.struts.action.ActionMapping;
import?org.apache.struts.actions.DispatchAction;
public?class?ElectiveAction?extends?DispatchAction?{
//本方法用于初始化選課頁面,顯示用戶能選的課程
public?ActionForward?init(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
//?TODO?Auto-generated?method?stub
try{
ElectiveHandler?eh?=?new?ElectiveHandler();
HttpSession?hs?=?request.getSession();
List?courses?=?eh.queryOptionalCourseById(Integer.valueOf(hs.getAttribute(“stu_id“).toString()).intValue());
request.setAttribute(“courses“?courses);
return?mapping.findForward(“showElective“);
}catch(Exception?e)?{
return?mapping.findForward(“login“);
}
}
//執行選課任務,用戶提交一組所選課的課號
public?ActionForward?elective(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
//?TODO?Auto-generated?method?stub
/*ElectiveHandler?eh?=?new?ElectiveHandler();
HttpSession?hs?=?request.getSession();
List?courses?=?eh.queryOptionalCourseById(Integer.valueOf(hs.getAttribute(“stu_id“).toString()).intValue());
request.setAttribute(“courses“?courses);*/
try{
HttpSession?hs?=?request.getSession();
ElectiveHandler?eh?=?new?ElectiveHandler();
String[]?course_ids?=?request.getParameterValues(“course_ids“);
eh.elective(Integer.valueOf(hs.getAttribute(“stu_id“).toString()).intValue()?course_ids);
return?mapping.findForward(“reShowElective“);
}catch(Exception?e){
return?mapping.findForward(“login“);
}
/*String[]?course_id?=?request.getParameterValues(“course_ids“);
System.out.println(course_id.length);
return?mapping.findForward(“login“);*/
}
//根據用戶提交的一組課序號,執行取消選課的任務
public?ActionForward?deleteElective(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
//?TODO?Auto-generated?method?stub
try{
HttpSession?hs?=?request.getSession();
ElectiveHandler?eh?=?new?ElectiveHandler();
String[]?course_ids?=?request.getParameterValues(“course_ids“);
eh.deleteElective(Integer.valueOf(hs.getAttribute(“stu_id“).toString()).intValue()?course_ids);
return?mapping.findForward(“showCourses“);
}catch(Exception?e){
return?mapping.findForward(“login“);
}
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????7730??2011-05-19?09:43??New?Project?20110519?0943.sql
?????目錄???????????0??2013-09-24?14:02??teachBS\
?????文件?????????547??2011-05-15?15:37??teachBS\.classpath
?????目錄???????????0??2011-05-15?10:21??teachBS\.myeclipse\
?????文件?????????295??2011-05-18?22:11??teachBS\.myme
?????文件?????????250??2011-05-15?10:24??teachBS\.mystrutsdata
?????文件????????1496??2011-05-18?22:10??teachBS\.project
?????目錄???????????0??2013-09-24?14:02??teachBS\.settings\
?????文件?????????500??2011-05-15?10:21??teachBS\.settings\.jsdtscope
?????文件????????1040??2011-05-18?22:11??teachBS\.settings\com.genuitec.eclipse.j2eedt.core.prefs
?????文件?????????334??2011-05-15?10:21??teachBS\.settings\org.eclipse.jdt.core.prefs
?????文件??????????49??2011-05-15?10:21??teachBS\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2011-05-15?10:21??teachBS\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2013-09-24?14:02??teachBS\src\
?????目錄???????????0??2013-09-24?14:02??teachBS\src\action\
?????文件????????2830??2011-05-16?15:17??teachBS\src\action\ElectiveAction.java
?????文件????????1072??2011-05-16?15:18??teachBS\src\action\LoginAction.java
?????文件????????1724??2011-05-16?15:20??teachBS\src\action\QueryAction.java
?????目錄???????????0??2013-09-24?14:02??teachBS\src\com\
?????目錄???????????0??2013-09-24?14:02??teachBS\src\command\
?????文件????????2728??2011-05-18?22:03??teachBS\src\command\ElectiveCommand.java
?????文件?????????628??2011-05-18?22:03??teachBS\src\command\LoginCommand.java
?????文件????????3163??2011-05-18?22:03??teachBS\src\command\QueryCommand.java
?????目錄???????????0??2013-09-24?14:02??teachBS\src\com\struts\
?????文件??????????76??2011-05-15?10:24??teachBS\src\com\struts\ApplicationResources.properties
?????目錄???????????0??2013-09-24?14:02??teachBS\src\dbTools1\
?????文件????????2806??2011-05-18?22:03??teachBS\src\dbTools1\DBTools.java
?????目錄???????????0??2013-09-24?14:02??teachBS\src\form\
?????文件????????1173??2011-05-16?14:05??teachBS\src\form\Course.java
?????文件?????????821??2011-05-15?15:32??teachBS\src\form\Student.java
?????目錄???????????0??2013-09-24?14:02??teachBS\src\handler\
............此處省略167個文件信息
- 上一篇:Android 開發即時聊天工具 YQ 1.3
- 下一篇:數據庫課設
評論
共有 條評論