-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi All
I want to integrate zkoss with strust2.
OrderListComposer.zul <window id="test" apply="${orderListComposer}"> <button id="testButton" label="test"/> </window> @org.springframework.stereotype.Component("orderListComposer") @Scope("prototype") public class OrderListComposer extends GenericForwardComposer{ public void onClick$testButton(){ Window win = Executions.createComponents("/iframe.zul", null, null); Iframe orderJspViewFile = (Iframe )win.getChildren().get(0); orderJspViewFile.setSrc("/welcome.action");// strust2 sction url } } iframe.zul <window> <iframe id="orderJspViewFile "/> </window> Struts action class import com.opensymphony.xwork2.ActionSupport; public class HelloWorld extends ActionSupport { @Action(value="/welcome",results={ @Result(name="success", type = "redirect", location="/welcome.zul")}) public String execute() throws Exception { return SUCCESS; } } welcome.zul; <window apply="${welcome}"> <label id="nameLabel"/> </window> @org.springframework.stereotype.Component("welcome ") @Scope("prototype") public class Welcome extends GenericForwardComposer{ private Label nameLabel; public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); nameLabel.setValue("successs full redirect by strust2 action"); } }
Asked: 2011-10-19 10:25:54 +0800
Seen: 252 times
Last updated: Oct 19 '11