departmentform.java
来自「是jsp开发与应用详解的全部源代码」· Java 代码 · 共 44 行
JAVA
44 行
package com.jspdev.ch18;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.*;import javax.servlet.http.HttpServletRequest; public class DepartmentForm extends ActionForm { private Department department=new Department() ; public void setDepartment(Department department) { this.department=department; } public Department getDepartment() { return this.department; } public void setName(String name) { this.department.setName(name); } public String getName() { return this.department.getName(); } public void reset(ActionMapping mapping, HttpServletRequest request) { this.department=new Department() ; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((department.getName() == null) || (department.getLeader()==null)) { errors.add("password", new ActionError("error.user.password")); } return errors; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?