DescriptionThis tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace. The body content of the tag is used to render the results from the Action. Any result processor defined for this action in xwork.xml will be ignored, unless the executeResult parameter is specified. Parameters
Examplespublic class ActionTagAction extends ActionSupport { public String execute() throws Exception { return "done"; } public String doDefault() throws Exception { ServletActionContext.getRequest().setAttribute("stringByAction", "This is a String put in by the action's doDefault()"); return "done"; } } <xwork> .... <action name="actionTagAction1" class="tmjee.testing.ActionTagAction"> <result name="done">success.jsp</result> </action> <action name="actionTagAction2" class="tmjee.testing.ActionTagAction" method="default"> <result name="done">success.jsp</result> </action> .... </xwork> <div>The following action tag will execute result and include it in this page</div> <br /> <ww:action name="actionTagAction" executeResult="true" /> <br /> <div>The following action tag will do the same as above, but invokes method specialMethod in action</div> <br /> <ww:action name="actionTagAction!specialMethod" executeResult="true" /> <br /> <div>The following action tag will not execute result, but put a String in request scope under an id "stringByAction" which will be retrieved using property tag</div> <ww:action name="actionTagAction!default" executeResult="false" /> <ww:property value="#attr.stringByAction" /> |