Dear all,
In the context of an <s:form> tag, for instance for a login action, we
previously always coded forms as :
<s:form action="login" namespace="/">....
And in the struts.xml we have been using :
<action name="login_*" method="{1}" class="com.company.LoginAction">
<result name="input" type="tiles">content.login</result>
<result name="success" type="tiles">content.menu</result>
<result name="summary" type="chain">summary_input</result>
<result name="session_error" type="chain">welcome</result>
</action>
This has worked in the past and allowed us to not only use the action="login"
to target the execute method of the action, but also to build links to, for
instance, login_checkStatus.action to target other, specific methods within the
action. I am not sure this Is a common/best practice, I had no prior struts2
experience before joining this company and this is how a lot of the existing
functionality is coded. (If this is wrong/there is a better way, please let me
know)
Now randomly, this fails to generate the proper action url in the html (it is
missing the '.action', which results in a 404 once you post the form)
The only workaround we have found so far is to add the '.action' suffix to the
s:form's action attribute. Before it was always added for us by struts.
So now we are having success with
<s:form action="login.action" namespace="/">...
I can only assume that this has been affected by the changes related to S2-015
and the wildcard action matching.
Any help would be greatly appreciated.
Bruno Litman