?? roombuyinfopage.java
字號:
package imis_hous.com.servlet;
import imis_hous.com.dao.RoomBuyInfoDAO;
import imis_hous.com.factory.SessionFactoryDAO;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class RoomBuyInfoPage extends HttpServlet {
/**
* Constructor of the object.
*/
public RoomBuyInfoPage() {
super();
}
/**
* Destruction of the servlet. <br>
*/
@Override
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
request.setCharacterEncoding("gb2312");
String J_RoomInfo=request.getParameter("J_RoomInfo");
String roomBuyDate=request.getParameter("J_RoomBuyDate");
String roomBuyDateed=request.getParameter("J_RoomBuyDateed");
RoomBuyInfoDAO page = SessionFactoryDAO.getRoomBuyInfoDAOInstance();
List list = null;
int currentPage = 1;
try {
currentPage = Integer.parseInt(request.getParameter("currentPage"));
} catch (NumberFormatException nfe) {
currentPage = 1;
}
try {
list = page.pageCount(currentPage,J_RoomInfo,roomBuyDate,roomBuyDateed);
} catch (Exception e) {
request.getRequestDispatcher("../imis_hous/Check/RoomBuyInfo_cx.jsp")
.forward(request, response);
e.printStackTrace();
return;
}
request.setAttribute("totalRecords", page.getAllRecords());
request.setAttribute("totalPages", page.getAllPages());
request.getSession().setAttribute("list", list);
request.setAttribute("currentPage", currentPage);
request.getRequestDispatcher("../imis_hous/view/RoomBuyInfoPage.jsp").forward(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
public void init() throws ServletException {
// Put your code here
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -