public class UserAction{private User user;public String add(){System.out.println("name="+user.getName());System.out.println("age="+user.getAge());return SUCCESS;}public User getUser(){return user;}public void setUser(User user){this.user=user;}}可用user!add?user.name=xx&user.ag Read More
posted @ 2011-12-26 16:02 汉卿 Views(358) Comments(0) Diggs(0) Edit
Action 自动把属性的值接收到成员变量里private String name;private int age;public void setName(String name){this.name=name;}public void setAge(int age){this.age=age;}Action调用setName来给name赋值,set后的名称要跟参数名称相同即setName则参数名为Name。 Read More
posted @ 2011-12-26 15:43 汉卿 Views(208) Comments(0) Diggs(0) Edit
1.当调用方法为x时{1}即为x<package name="actions" extends="struts-default" namespace="/actions"><action name="Student*" class="" method="{1}"><result>/Student{1}_success</result><action><action name="*_*" cl Read More
posted @ 2011-12-26 15:22 汉卿 Views(255) Comments(0) Diggs(0) Edit
1.<action name="user" class="" method="xxx"><result>xxx</result></action>可以通过设置Action的method属性来改变出发此action的默认方法,Action的默认触发方法是execute。2.可以通过Action名称后加!+方法名来实现对不同方法的调用。<action name="user" class=""><result>xxx</re Read More
posted @ 2011-12-26 15:12 汉卿 Views(298) Comments(0) Diggs(0) Edit