ITeye博客

webwork学习2

wzw00001 · 2007-12-04 15:29 · webwork · Markdown

webwork学习2 zt 表单数据的获取 1、Action:“Form.java”

import com.opensymphony.xwork.ActionSupport; import java.util.ArrayList;

public class Form extends ActionSupport{

String name; int sex; boolean mem = false; ArrayList fav = new ArrayList(); String concat;

public String getName() { return this.name; }

public void setName(String name) { this.name = name; }

public void setSex(int sex) { this.sex = sex; }

public int getSex() { return this.sex; }

public void setFav(String favs) { for (int i = 0; i < favs.length; ++i) { this.fav.add(favs*); } }

public ArrayList getFavs() { return this.fav; }

public void setConcat(String concat) { this.concat = concat; }

public String getConcat() { return this.concat; }

public void setMem(boolean mem) { this.mem = mem; }

public boolean getMems() { return this.mem; }

public String execute() throws Exception { if (this.name == null || this.name.equals("")) { return "input"; } return "success"; }

}

2、“input.jsp”

<%@page contentType="text/html"%> <%@page pageEncoding="gbk"%> <%@ taglib uri="/WEB-INF/webwork.tld" prefix="ww" %>

3、“success.jsp”

<%@page contentType="text/html"%> <%@page pageEncoding="gbk"%> <%@ taglib uri="/WEB-INF/webwork.tld" prefix="ww" %>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。