hezjing wrote:
Hi

In http://struts.apache.org/2.0.11/docs/submit.html, the submit tag
has an "action" attribute that says "set action attribute."

May I know how can we make use of this action attribute?
Any example?

Thank  you!


It simply overrides the action attribute of the form:

<s:submit name="submit" value="a" action="action1"/>
<s:submit name="submit" value="a" action="action2"/>

where action1 and action2 are actions named in struts.xml

The way it works is that the value of the button has the name of the action added to it. The ActionMap in struts2 inspects the params, detects the "action:" prefix and executes the named action instead of the one in the URL. The prefix is then stripped off the value.

The method attribute works the same way (adds a method: prefix)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to