???????Java ???????????????????
???????????? ???????[ 2014/4/9 10:54:39 ] ??????????????? ???? java
<span style="font-family:FangSong_GB2312;font-size:18px;">import java.text.*;
import java.util.*;
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
import com.bjpowernode.exam.model.*;
import com.bjpowernode.exam.manager.*;
public class SearchStudentServlet extends HttpServlet {
public void doGet(HttpServletRequest request?? HttpServletResponse response)
throws ServletException?? IOException {
doPost(request?? response);
}
public void doPost(HttpServletRequest request?? HttpServletResponse response)
throws ServletException?? IOException {
String sBeginDate = request.getParameter("beginDate");
String sEndDate = request.getParameter("endDate");
Date beginDate = new Date();
Date endDate = new Date();
try {
beginDate = new SimpleDateFormat("yyyy-MM-dd").parse(sBeginDate);
endDate = new SimpleDateFormat("yyyy-MM-dd").parse(sEndDate);
}catch(Exception e) {
e.printStackTrace();
}
StudentManager studentManager = new StudentManagerImpl();
List<Student> studentList = studentManager.findStudentList(beginDate?? endDate);
//??????б??????requet??Χ??
//request.setAttribute("student_list"?? studentList);
//??????????????????????????????????????
//request.getRequestDispatcher("/student_list.jsp").forward(request?? response);
//??studentList???session??
HttpSession session = request.getSession();
session.setAttribute("student_list"?? studentList);
//???????????request
//????д???????? "/"??????8080???
//response.sendRedirect("/student_list.jsp");
response.sendRedirect(request.getContextPath() + "/student_list.jsp");
}
}</span>
|
??????????波????????????????Jsp????????servlet?е????????????????????£?
??????????:
????<span style="font-family:FangSong_GB2312;font-size:18px;">//??????????????????????????????????????
????request.getRequestDispatcher("/student_list.jsp").forward(request?? response);</span>
?????????????????????????????????request/response???????????????????????????????????????????????????A??????????м??B??????C??D?? ???????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11