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

📄 ordercourseaction.java

📁 本程序所写的排课
💻 JAVA
字号:
package com.briup.web.action;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;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 org.apache.struts.actions.LookupDispatchAction;import com.briup.bean.Classroom;import com.briup.bean.Course;import com.briup.bean.Deploy;import com.briup.common.BeanFactory;import com.briup.service.impl.CourseServiceImpl;public class OrderCourseAction extends LookupDispatchAction{	@Override	protected Map getKeyMethodMap() {				Map<String, String> map = new HashMap<String, String>();		map.put("submit.reset", "reset");		map.put("submit.search", "search");		map.put("submit.ok", "ok");		map.put("submit.info", "info");		return map;	}	public ActionForward reset(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {		CourseServiceImpl service = (CourseServiceImpl)BeanFactory.getBean(BeanFactory.COURSESERVICEIMPL);		List<Deploy> deployList = new ArrayList<Deploy>();		List<Course> courselist = (List<Course>) request.getSession().getServletContext().getAttribute("courseList");		List<Classroom> roomlist = (List<Classroom>) request.getSession().getServletContext().getAttribute("roomList");		deployList = service.planOfCourse(courselist, roomlist);		deployList = service.transDeploy(deployList, roomlist);		request.getSession().getServletContext().setAttribute("deployList", deployList);//		for(Deploy deploy : deployList)//		{//			System.out.println(deploy.getRoom().getId()+":\t"+deploy.getCourse().getName()+":\t"+deploy.getTime());//		}		request.removeAttribute("message");//		request.setAttribute("message", false);		return mapping.findForward("success");	}		public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {		System.out.println("AddDelAction's add method is invoking!");		return null;	}		public ActionForward ok(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {		System.out.println("OkAction's add method is invoking!");		return null;	}		public ActionForward info(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {		System.out.println("InfoAction's add method is invoking!");		return null;	}}

⌨️ 快捷键说明

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