public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
Mylog.log.info("queryAll");

 

int currentPage = 1;//當前頁
int lineSize = 8;//每一顯示的記錄數
int allRecorders = 0;//總頁數
String keyWord = null;//用於搜索的關鍵字
try {
keyWord = request.getParameter("kw");//獲取搜索的關鍵字
currentPage = Integer.parseInt(request.getParameter("cp")) ;//獲取當前頁
} catch (Exception e) {
}
List<Question> ques = null;
ques = this.iquestiondao.queryAll(currentPage, lineSize);//獲取記錄
allRecorders = this.iquestiondao.queryAllCount();//獲取總頁數
request.setAttribute("all", ques);
request.setAttribute("currentPage", currentPage);
request.setAttribute("lineSize", lineSize);
request.setAttribute("allRecorders", allRecorders);
request.setAttribute("<a href="HTTP://www.it165.net/pro/webjsp/" target="_blank" class="keylink">jsp</a>Url", "show.do");//執行的位址
request.setAttribute("status", "");
request.setAttribute("keyWord", keyWord);
return mapping.findForward("showquestion");
}
創作者介紹
創作者 shadow 的頭像
shadow

資訊園

shadow 發表在 痞客邦 留言(0) 人氣()