📄 meetingroomlistaction.java.keep
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.wondersgroup.businessmodule.meetingmanage.web.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
import com.wondersgroup.businessmodule.meetingmanage.service.MeetingService;
import com.wondersgroup.framework.core.bo.Page;
/**
* MyEclipse Struts
* Creation date: 06-28-2007
* @author liah
* XDoclet definition:
* @struts.action path="/meetingListAction" name="meetingListForm" input="/business/meeting/meetingRoomList.jsp" scope="request"
* @struts.action-forward name="listPage" path="/business/meeting/meetingRoomList.jsp"
*/
public class MeetingRoomListAction extends Action {
/*申明服务*/
private MeetingService service;
private Page page;
private int curPage;
private int pageSize;
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
DynaActionForm meetingRoomListForm = (DynaActionForm) form;// TODO Auto-generated method stub
/*如果没有输入页码,初始化当前页为第一页*/
if(meetingRoomListForm.getString("curPage") == null ||
meetingRoomListForm.getString("curPage").trim().equals("")){
curPage = 1;
}else{
try{
curPage = Integer.parseInt(meetingRoomListForm.getString("curPage"));
}catch(NumberFormatException nfe){
//处理异常
nfe.printStackTrace();
curPage = 1;
}
}
page = service.getRoomList(0, meetingRoomListForm.getString("name").trim(), curPage, 4);
meetingRoomListForm.set("curPage", String.valueOf(page.getCurrentPageNo()));
request.setAttribute("page", page);
return mapping.findForward("listPage");
}
/*服务注入方法*/
public void setService(MeetingService service) {
this.service = service;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -