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

📄 userloginform.java

📁 《基于Eclipse的开源框架技术与实战》[第10章]随书源码
💻 JAVA
字号:
package com.free.web.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.*;

/**
 * <p>Title: Eclipse Plugin Development</p>
 * <p>Description: Free download</p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: Free</p>
 * @author gan.shu.man
 * @version 1.0
 */

public class UserLoginForm extends ActionForm {

	private String action = "add";

	private String userid = null;

	private String password = null;

	public void reset(ActionMapping mapping, HttpServletRequest request) {

		this.userid = null;
		this.password = null;

		this.action = "add";

	}

	public ActionErrors validate(

	ActionMapping mapping, HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		/*
		 * if( getUserid() == null || getUserid().length() < 1 ) {
		 * errors.add("username",new ActionMessage("error.username.required")); }
		 * if( getPassword() == null || getPassword().length() < 1 ) {
		 * errors.add("password",new ActionMessage("error.password.required")); }
		 * 
		 */
		return errors;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

}

⌨️ 快捷键说明

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