// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package demo;

import com.opensymphony.xwork2.ActionSupport;

public class AddAction extends ActionSupport {
    // form data
    private String f1;
    private String f2;
    private String f3;
    public String getF1() {
        return f1;
    }
    public void setF1(String f1) {
        this.f1 = f1;
    }
    public String getF2() {
        return f2;
    }
    public void setF2(String f2) {
        this.f2 = f2;
    }
    public String getF3() {
        return f3;
    }
    public void setF3(String f3) {
        this.f3 = f3;
    }
    // execute action
    public String execute() {
        // save
        DB.saveOne(new T1(Integer.parseInt(f1), f2, f3));
        // forward to configured list redirect
        return "list";
    }
}
