日期:2014-05-17 浏览次数:20783 次
public class Clas {
private int id;
private int orde;//专业几班
private int birthday;//多少级
private int majorId;
private int bossId;
上面是action
public class ClasAction extends ActionSupport {
private ClasService cs = new ClasService();
private Clas c;
public String add() {
System.out.println("cs:"+cs);
System.out.println("c:"+c);
cs.add(c);
System.out.println("Clas_add!");
return SUCCESS;
}
上面是jsp
班级增加<br/>
<s:form action="admin/Clas_add" method="post">
<s:hidden name="c.id"/>
<s:textfield name="c.orde" label="多少班" />
<s:textfield name="c.birthday" label="年级" />
<s:textfield name="c.majorId" label ="专业id"/>
<s:textfield name="c.bossId" label="班主任id" />
<s:submit/>
</s:form>