📄 deptmonthpointservlet.java
字号:
package com.selectpoint;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import com.login.UserDBOperation;
public class DeptMonthPointServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
String year = request.getParameter("year");
String month = request.getParameter("month");
request.setAttribute("year", year);
request.setAttribute("month", month);
HttpSession session = request.getSession();
try {
/*
* ApplicationContext ctx = WebApplicationContextUtils
* .getRequiredWebApplicationContext(getServletContext());
* com.hbmDAO.DeptAssesDAO dao = (com.hbmDAO.DeptAssesDAO) ctx
* .getBean("deptassesDAO"); List a=dao.getDeptMonthPoint(year,
* month);
*/
DeptMonthPoint deptMonthPoint = new DeptMonthPoint();
Collection deptmonthpoints = deptMonthPoint.getDeptMonthPoints(
year, month);
UserDBOperation dbo = new UserDBOperation();
Collection deptPerson = dbo.getAssesUsers();
session.setAttribute("deptPerson", deptPerson);
session.setAttribute("deptmonthpoints", deptmonthpoints);
RequestDispatcher requestDispatcher = request
.getRequestDispatcher("/selectpoint/deptmonthpoint.jsp");
requestDispatcher.forward(request, response);
} catch (Exception e) {
RequestDispatcher requestDispatcher = request
.getRequestDispatcher("/selectpoint/deptmonthpoint.jsp");
requestDispatcher.forward(request, response);
} finally {
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -