📄 productform.java
字号:
package app03c.form;
import java.util.ArrayList;
import org.apache.struts.util.LabelValueBean;
import org.apache.struts.action.ActionForm;
public final class ProductForm extends ActionForm {
private String category;
public void setCategory (String category) {
this.category = category;
}
public String getCategory () {
return category;
}
//Populate data for select options
public ArrayList getCategoryList() {
ArrayList colorList = new ArrayList(3);
colorList.add(new LabelValueBean("Computer", "Com"));
colorList.add(new LabelValueBean("Camera", "Cam"));
colorList.add(new LabelValueBean("Mobile Phone", "MP"));
return colorList;
}
public ArrayList getCategoryLabels() {
ArrayList categoryLabels = new ArrayList(3);
categoryLabels.add("Computer");
categoryLabels.add("Camera");
categoryLabels.add("Mobile Phone");
return categoryLabels;
}
public ArrayList getCategoryValues() {
ArrayList categoryValues = new ArrayList(3);
categoryValues.add("Com");
categoryValues.add("Cam");
categoryValues.add("MP");
return categoryValues;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -