📄 loginform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.yourcompany.struts.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.ActionError;
/**
* MyEclipse Struts
* Creation date: 05-20-2009
*
* XDoclet definition:
* @struts.form name="loginForm"
*/
public class LoginForm extends ActionForm {
/*
* Generated fields
*/
/** uname property */
private String uname;
/** pwd property */
private String pwd;
/*
* Generated Methods
*/
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
ActionErrors errors = new ActionErrors();
if(uname.equals("")||uname==null){
errors.add("uname", new ActionError("err.uname"));
}
if(pwd.equals("")||pwd==null){
errors.add("pwd", new ActionError("err.pwd"));
}
return errors;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* Returns the uname.
* @return String
*/
public String getUname() {
return uname;
}
/**
* Set the uname.
* @param uname The uname to set
*/
public void setUname(String uname) {
this.uname = uname;
}
/**
* Returns the pwd.
* @return String
*/
public String getPwd() {
return pwd;
}
/**
* Set the pwd.
* @param pwd The pwd to set
*/
public void setPwd(String pwd) {
this.pwd = pwd;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -