userinfoform.java

来自「这是一个通过来struts和hiberate实现的用户注册登陆源代码」· Java 代码 · 共 100 行

JAVA
100
字号
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xslpackage com.mycompany.struts.form;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.ActionError;import org.apache.struts.action.ActionErrors;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionMapping;import org.hibernate.Query;import org.hibernate.Session;import org.hibernate.Transaction;import java.util.List;import com.mycompany.HibernateSessionFactory;import com.mycompany.po.UserInfo;/**  * MyEclipse Struts * Creation date: 12-21-2005 *  * XDoclet definition: * @struts.form name="userInfoForm" */public class UserInfoForm extends ActionForm {	// --------------------------------------------------------- Instance Variables	/** password property */	private String password;	/** name property */	private String name;	// --------------------------------------------------------- Methods	/** 	 * Method validate	 * @param mapping	 * @param request	 * @return ActionErrors	 */	public ActionErrors validate(		ActionMapping mapping,		HttpServletRequest request) {		ActionErrors nerror=new ActionErrors();		if(this.name==null||this.name.length()==0||this.password==null||this.password.length()==0){			nerror.add("name",new ActionError("nopnull"));		}		return nerror;			}	/** 	 * Method reset	 * @param mapping	 * @param request	 */	public void reset(ActionMapping mapping, HttpServletRequest request) {		// TODO Auto-generated method stub	}	/** 	 * Returns the password.	 * @return String	 */	public String getPassword() {		return password;	}	/** 	 * Set the password.	 * @param password The password to set	 */	public void setPassword(String password) {		this.password = password;	}	/** 	 * Returns the name.	 * @return String	 */	public String getName() {		return name;	}	/** 	 * Set the name.	 * @param name The name to set	 */	public void setName(String name) {		this.name = name;	}}

⌨️ 快捷键说明

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