I'm trying to learn how to operate with links using namespaces, actions and Struts tags.
I have a simple login form in index.jsp
page:
<s:form action="login" method="POST" namespace="/welcome">
<s:textfield name="email" label="e-mail" type="email"></s:textfield>
<s:password name="password" label="Password" type="password"></s:password>
<s:submit value="Log-in"></s:submit>
</s:form>
<s:url var="url" namespace="/client" action="register"></s:url>
<p>
<s:a label="Register" href="#url" />
</p>
And following mapping in struts.xml
:
<struts>
<constant name="struts.devMode" value="true" />
<package name="welcome" namespace="/welcome" extends="struts-default">
<action name="index">
<result>/index.jsp</result>
</action>
</package>
<package name="client" namespace="/client" extends="struts-default">
<action name="register"
class="magazine.action.client.RegisterClientAction"
method="execute">
<result name="input" type="redirect">/index.jsp</result>
</action>
<action name="login"
class="magazine.action.client.LoginClientAction"
method="execute">
<result name="input" type="redirect">/WEB-INF/view/client/view.jsp
</result>
<result name="error" type="redirect">/index.jsp</result>
</action>
</package>
</struts>
The index.jsp
is displaying, but I'm getting in debug mode is: No configuration found for the specified action
.
And register link also appears, but it's broken. I saw similar posts and main goal in answers was to check namespaces and syntax issues. I'm a starter in Struts 2, but didn't see that problems in my code, maybe I'm using it in the wrong way ?