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

📄 logonform.java

📁 j2ee技术内幕源码包括了这本书的所有代码
💻 JAVA
字号:
package unleashed.ch20.struts;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.*;public class LogonForm extends ActionForm {     /**     * The password.     */    private String password = null;    /**     * The username.     */    private String username = null;    /**     * Gets the password.     */    public String getPassword()     {	    return password;    }    /**     * Sets the password.     *     * @param password The new password     */    public void setPassword(String password)     {        this.password = password;    }    /**     * Gets the username.     */    public String getUsername()     {    	    return username;    }    /**     * Sets the username.     *     * @param username The new username     */    public void setUsername(String username)     {        this.username = username;    }    /**    * Validates username and password.    */       public ActionErrors validate(ActionMapping mapping,                                 HttpServletRequest request)     {        ActionErrors errors = new ActionErrors();        if ((username == null) || (username.length() < 1))            errors.add("username", new ActionError("error.username.required"));        if ((password == null) || (password.length() < 1))            errors.add("password", new ActionError("error.password.required"));        return errors;    }}

⌨️ 快捷键说明

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