• 大小: 4.34MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-17
  • 语言: Java
  • 标签: jsp  

资源简介

基于jsp的课程作业提交系统 数据库支持,sqlserver 欢迎评价

资源截图

代码片段和文件信息

package com.cn.action;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.cn.model.Admin;
import com.cn.model.News;
import com.cn.model.Teacher;
import com.cn.model.Teaching;
import com.cn.service.AdminService;
import com.cn.service.AlluserService;

public class AdminAction extends baseAction{

public ActionForward a(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response){

return mapping.findForward(“allnews“);

}
public ActionForward listNews(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response){

AdminService aService = AdminService.getInstance();
Listallnews = aService.listNews();
request.setAttribute(“allnews“ allnews);
return mapping.findForward(“list“);

}
public ActionForward login(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response){

MyForm form2 = (MyForm) form;
 Admin admin = (Admin) form2.toBean(new Admin());
String name = admin.getName();
String pass = admin.getPassword();

if (name.equals(“admin“)&&pass.equals(“123“)) {
request.getSession().setAttribute(“login“ “ok“);
try {
response.sendRedirect(“/school/admin/index.jsp“);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else {
try {
response.sendRedirect(“/school/login/login.jsp“);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return null;
}


public ActionForward deleteNews(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response){
int id = Integer.parseInt(request.getParameter(“id“));
AdminService aService = AdminService.getInstance();
try {
aService.deleteNews(id);
} catch (RuntimeException e) {

e.printStackTrace();
}
return mapping.findForward(“list“);

}

public ActionForward addNews(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response){
MyForm f = (MyForm) form;
News news = (News) f.toBean(new News());
AdminService aService = AdminService.getInstance();
try {
aService.addNews(news);
} catch (RuntimeException e) {

e.printStackTrace();
}
return mapping.findForward(“list“);

}
public ActionForward getTeaching(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response){

AdminService aService = AdminService.getInstance();
List t=null;
try {
 t = aService.getTeaching();
} catch (RuntimeException e) {

e.printStackTrace();

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1307  2009-05-05 14:42  school\.project

     文件        143  2008-08-13 14:05  school\src\util\RowProccess.java

     文件        806  2008-08-11 17:15  school\src\util\DatabaseFilter.java

     文件       4930  2009-04-25 19:11  school\src\util\Database.java

     文件        296  2008-08-11 17:15  school\src\util\DatabaseException.java

     文件        144  2009-05-05 13:17  school\src\jdbc.properties

     文件        976  2009-05-05 15:24  school\src\com\cn\filter\CharacterFilter.java

     文件       1435  2009-06-07 17:17  school\src\com\cn\filter\LoginFilter.java

     文件       1509  2009-05-06 10:46  school\src\com\cn\action\baseAction.java

     文件       5866  2009-05-20 17:07  school\src\com\cn\action\AllUsersAction.java

     文件       1463  2009-05-07 08:35  school\src\com\cn\action\UploadAction.java

     文件        972  2009-05-09 08:49  school\src\com\cn\action\MyForm.java

     文件       4596  2009-06-07 16:11  school\src\com\cn\action\AdminAction.java

     文件        794  2009-06-05 21:07  school\src\com\cn\action\LoginAction.java

     文件        623  2009-05-20 16:38  school\src\com\cn\model\News.java

     文件        721  2009-05-08 21:09  school\src\com\cn\model\Teaching.java

     文件        407  2009-05-08 22:20  school\src\com\cn\model\Teacher.java

     文件        844  2009-05-08 23:23  school\src\com\cn\model\MyBBS.java

     文件        456  2009-05-28 20:04  school\src\com\cn\model\Admin.java

     文件       6110  2009-06-07 10:34  school\src\com\cn\service\AlluserService.java

     文件       3320  2009-06-07 11:01  school\src\com\cn\service\AdminService.java

     文件         49  2009-05-05 14:42  school\src\App.properties

     文件        505  2009-05-07 14:24  school\src\test\testAllUserService.java

     文件        144  2009-05-05 13:17  school\WebRoot\WEB-INF\classes\jdbc.properties

     文件         49  2009-05-05 14:42  school\WebRoot\WEB-INF\classes\App.properties

     文件        220  2009-05-05 15:11  school\WebRoot\WEB-INF\classes\util\RowProccess.class

     文件       1162  2009-05-05 15:11  school\WebRoot\WEB-INF\classes\util\DatabaseFilter.class

     文件        592  2009-05-05 15:11  school\WebRoot\WEB-INF\classes\util\DatabaseException.class

     文件       5250  2009-05-05 15:11  school\WebRoot\WEB-INF\classes\util\Database.class

     文件       1390  2009-05-05 15:24  school\WebRoot\WEB-INF\classes\com\cn\filter\CharacterFilter.class

............此处省略132个文件信息

评论

共有 条评论