Do Struts tags <s:submit> and <sj:submit> work on same form? I have already Struts buttons <s:submit>, but now I have added <sj:submit>.
So, Struts 2 jQuery plugin button is working good, but Struts <s:submit> is not working.
<head>
<sj:head/>
</head>
<s:form id="myForm" action="part!list">
<s:submit action="part" method="list" />
</s:form>
<sj:submit targets="result" formId="myform"/>
<s:submit>works with the form if it's inside the body of the<s:form>or<form>tag. To make it work properly use theactionattribute to map the form to the action. You could also use<s:url>to build the url used in theactionattribute of the form that correctly builds url even with parameters. But if you map the action in the<s:submit>tag then you have to use only one attributeactionormethod. These are special parameters used by the action mapper. In the first case formactionwill be overridden, in the second case the action method overridden. It means that the attributesactionandmethodin the<submit>tag only used to override the default form action mapping. It's rarely used, requires DMI, if you have multiple buttons that have different methods consider to use themethodattribute to override the form action mapping.EDIT:
Example:
the above
<s:submit>in the first case use actin namedpart2to submit to, the second action namepartand methodlist2, the third is default action namepartand methodlistAjax calls like the third case.If your action is mapped on the method
list, then you could simplify the url via