📄 timesheetsearchcontroller.java
字号:
package net.java.workeffort.webapp.action;import javax.servlet.http.HttpServletRequest;import net.java.workeffort.service.ITimesheetService;import net.java.workeffort.service.domain.PageResult;import net.java.workeffort.service.domain.TimesheetQuery;import org.apache.commons.lang.Validate;/** * Timesheet search controller. * @author Antony Joseph */public class TimesheetSearchController extends SearchController { protected void init() { Validate.notNull(service, "Service cannot be null"); Validate.notNull(getFormView(), "'formView' cannot be null"); Validate.notNull(getSuccessView(), "'successView' cannot be null"); Validate.notNull(getCommandClass(), "'commandClass' cannot be null"); if (pageSize == null) pageSize = new Integer(10); initLov(); } protected Object query(HttpServletRequest request, Object command) throws Exception { String timesheetUserType = request .getParameter(TimesheetCrudController.TIMESHEET_USER_TYPE); Validate.notNull(timesheetUserType, "Http request parameter " + TimesheetCrudController.TIMESHEET_USER_TYPE + " cannot be null"); TimesheetQuery query = (TimesheetQuery) command; ITimesheetService timesheetService = (ITimesheetService) getService(); if (TimesheetCrudController.USER.equals(timesheetUserType)) return timesheetService.getPageResultTimesheetUser(query); else if (TimesheetCrudController.SUPERVISOR.equals(timesheetUserType)) return timesheetService.getPageResultTimesheetSupervisor(query); else if (TimesheetCrudController.MANAGEMENT.equals(timesheetUserType)) return timesheetService.getPageResultTimesheetManagement(query); else throw new IllegalStateException( TimesheetCrudController.TIMESHEET_USER_TYPE + "=" + timesheetUserType + " is invalid"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -