LoginForm.java
资源名称:Ajax.rar [点击查看]
上传用户:sz_mindeo
上传日期:2015-07-22
资源大小:913k
文件大小:2k
源码类别:
Ajax
开发平台:
Java
- package com.haiku.form;
- /*
- * Generated by MyEclipse Struts
- * Template path: templates/java/JavaClass.vtl
- */
- 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;
- /**
- * MyEclipse Struts
- * Creation date: 03-13-2008
- *
- * XDoclet definition:
- * @struts.form name="loginForm"
- */
- public class LoginForm extends ActionForm {
- /*
- * Generated fields
- */
- /** password property */
- /** userName property */
- private String userName;
- private String password;
- /*
- * Generated Methods
- */
- /**
- * Method validate
- * @param mapping
- * @param request
- * @return ActionErrors
- */
- public ActionErrors validate(ActionMapping mapping,
- HttpServletRequest request) {
- // TODO Auto-generated method stub
- ActionErrors errors = null;
- System.out.println("来到validate方法");
- if(userName==null||userName.trim().equalsIgnoreCase("")||password==null||password.trim().equalsIgnoreCase(""))
- {
- System.out.println("validate里检验出错");
- errors = new ActionErrors();
- errors.add("error", new ActionMessage("名字或密码不能为空"));
- return errors;
- }
- else
- return null;
- }
- /**
- * 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 userName.
- * @return String
- */
- public String getUserName() {
- return userName;
- }
- /**
- * Set the userName.
- * @param userName The userName to set
- */
- public void setUserName(String userName) {
- this.userName = userName;
- }
- }