📄 queryexaminformationbydateaction.java
字号:
package action;
import java.io.*;
import java.util.*;
import vo.ExamVO;
import dao.ExamDAO;
import javax.servlet.*;
import javax.servlet.http.*;
public class QueryExamInformationByDateAction extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException
{
String examtime=request.getParameter("examtime");
ExamDAO examdao=new ExamDAO();
boolean isexist=examdao.checkDate(examtime);
if(!isexist)
{
response.setCharacterEncoding("gb2312");
response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("<html>");
out.println("<head><meta http-equiv=refresh content=2;url=QueryExamInformationByDateAction.jsp>");
out.println("<title>按学号查询考试信息</title></head>");
out.println("<body background=2.jpg>");
out.println("<br><br><br>");
out.println("<h1 align=center ><font color=red>对不起,该时间未有考试,无法查询</font></h1><hr>");
out.println("<br><br>");
out.println("</body>");
out.println("</html>");
}
else
{
ArrayList exams=(ArrayList)examdao.getExamInforsByDate(examtime);
HttpSession session=request.getSession(true);
session.setAttribute("examtime",exams);
this.getServletContext().getRequestDispatcher("/QueryExamInformationByDateResult.jsp").forward(request,response);
}
}
public void doPost(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException
{
doGet(request,response);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -