📄 studentaction.java
字号:
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.0/xslt/JavaClass.xslpackage cn.com.javapro.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 cn.com.javapro.form.StudentForm;import cn.com.javapro.fwk.PageRoll;import cn.com.javapro.service.IStudentService;import cn.com.javapro.service.StudentServiceImpl;import cn.com.javapro.vo.Student;/** * * @description:学生对象业务控制器 * @group: javapro * @author: vince * */public class StudentAction extends Action { // --------------------------------------------------------- Instance Variables // --------------------------------------------------------- Methods /** * Method execute * @param mapping * @param form * @param request * @param response * @return ActionForward */ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { StudentForm studentForm = (StudentForm) form; //分页属性类 PageRoll pageRoll = new PageRoll(); //获取当前页 if(request.getParameter("currentPage")!=null){ int currentPage = Integer.parseInt(request.getParameter("currentPage")); //设置当前页 pageRoll.setCurrentPage(currentPage); } //调用业务逻辑层查询数据对象 IStudentService studentService = new StudentServiceImpl(); Student[] student = studentService.search(pageRoll); request.setAttribute("student",student); request.setAttribute("pageRoll",pageRoll); return mapping.findForward("success"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -