⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userform.java

📁 struts做得固定资产管理系统 带毕业论文完整版
💻 JAVA
字号:
package com.qrsx.appcam.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class UserForm extends ActionForm {

	// 注意:ActionForm中的属性,必须是String类型的
	// 并且,必须和表单中控件名称对应起来
	private String id; // 主键

	private String logonName; // 登陆名

	private String password; // 密码

	private String employeeId;// 用户对应的员工编号

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		// 登陆名和密码不能为空
		if (logonName == null || logonName.length() < 1) {

			errors.add("loginName", new ActionMessage("error.loginName.required"));
		}

		if (password == null || password.length() < 1) {

			errors.add("password", new ActionMessage("error.password.required"));
		}

		return errors;
	}

	/**
	 * @return the employeeId
	 */
	public String getEmployeeId() {
		return employeeId;
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @return the logonName
	 */
	public String getLogonName() {
		return logonName;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param employeeId
	 *            the employeeId to set
	 */
	public void setEmployeeId(String employeeId) {
		this.employeeId = employeeId;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @param logonName
	 *            the logonName to set
	 */
	public void setLogonName(String logonName) {
		this.logonName = logonName;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -