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

📄 accountactionform.java

📁 学习struts标签库,里面随带了相关的演示程序代码,非常好学.
💻 JAVA
字号:
package org.apache.struts.webapp.exercise;

import java.util.List;
import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.webapp.exercise.Account;


public class AccountActionForm extends ActionForm {
    
    private static final List LANGUAGE_LIST = new ArrayList();
    private static final List CATEGORY_LIST = new ArrayList();
    
    private String username;
    private String password;
    private String repeatedPassword;   
    private String validate;
    private String forwardAction;
    private List languages = new ArrayList();
    private List categories = new ArrayList();
    private Account account = new Account();
    
    static {
        LANGUAGE_LIST.add("English");
        LANGUAGE_LIST.add("Chinese");
        
        CATEGORY_LIST.add("Phone");
        CATEGORY_LIST.add("Camera");
      }
    
    public AccountActionForm(){
        this.categories = CATEGORY_LIST ;
        this.languages  = LANGUAGE_LIST ;
    }
    
    
    /* (non-Javadoc)
     * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);
        account = new Account();
        this.username = "";
        this.password = "";
        this.repeatedPassword = "";
        this.categories = CATEGORY_LIST ;
        this.languages  = LANGUAGE_LIST ;
    }
    /**
     * @return Returns the account.
     */
    public Account getAccount() {
        return account;
    }
    /**
     * @param account The account to set.
     */
    public void setAccount(Account account) {
        this.account = account;
    }
    /**
     * @return Returns the categories.
     */
    public List getCategories() {
        return categories;
    }
    /**
     * @param categories The categories to set.
     */
    public void setCategories(List categories) {
        this.categories = categories;
    }
    /**
     * @return Returns the forwardAction.
     */
    public String getForwardAction() {
        return forwardAction;
    }
    /**
     * @param forwardAction The forwardAction to set.
     */
    public void setForwardAction(String forwardAction) {
        this.forwardAction = forwardAction;
    }
    /**
     * @return Returns the languages.
     */
    public List getLanguages() {
        return languages;
    }
    /**
     * @param languages The languages to set.
     */
    public void setLanguages(List languages) {
        this.languages = languages;
    }
    /**
     * @return Returns the password.
     */
    public String getPassword() {
        return password;
    }
    /**
     * @param password The password to set.
     */
    public void setPassword(String password) {
        this.password = password;
    }
    /**
     * @return Returns the repeatedPassword.
     */
    public String getRepeatedPassword() {
        return repeatedPassword;
    }
    /**
     * @param repeatedPassword The repeatedPassword to set.
     */
    public void setRepeatedPassword(String repeatedPassword) {
        this.repeatedPassword = repeatedPassword;
    }
    /**
     * @return Returns the username.
     */
    public String getUsername() {
        return username;
    }
    /**
     * @param username The username to set.
     */
    public void setUsername(String username) {
        this.username = username;
    }
    /**
     * @return Returns the validate.
     */
    public String getValidate() {
        return validate;
    }
    /**
     * @param validate The validate to set.
     */
    public void setValidate(String validate) {
        this.validate = validate;
    }
}

⌨️ 快捷键说明

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