public class TestAction extends ActionSupport { private TestBean myBean; public TestBean getMyBean() { return myBean; } public void setMyBean(TestBean myBean) { this.myBean = myBean; } protected String doExecute() throws Exception { myBean = new TestBean(); BeanUtil.setProperties(ActionContext.getContext().getParameters(), myBean); return SUCCESS; } }
<!-- This will call getMyBean() on your action and put it on the top of the value stack --> <webwork:property value="myBean"> <!-- This will call getName() on your TestBean and print it to the page --> The name is: <webwork:property value="name"/> </webwork:property>
<webwork:property value="myBean/name"/>