HTTP Status 404 - There is no Action mapped for namespace / and action name

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP Status 404 - There is no Action mapped for namespace / and action name

dilini
I am new to struts2. I have created a sample helloworld application.When i run the application i got the following error.

HTTP Status 404 - There is no Action mapped for namespace / and action name .


my login.jsp file is

<s:form action="login" method="post" >
<s:textfield name="username" key="username"></s:textfield>
<s:submit ></s:submit>

</s:form>

struts.xml file is

<package name="default" extends="struts-default" >
<action name="login"
class="net.vir.struts2.CurrencyConverter" namspace="/">
<result name="success">Welcome.jsp</result>
<result name="error">login.jsp</result>
</action>

</package>


give me any help.
Reply | Threaded
Open this post in threaded view
|

Re: HTTP Status 404 - There is no Action mapped for namespace / and action name

Yazii
Remove that namspace in action tag...



<package name="default" extends="struts-default" >
<action name="login"
class="net.vir.struts2.CurrencyConverter" >
<result name="success">Welcome.jsp</result>
<result name="error">login.jsp</result>
</action>

</package>
Reply | Threaded
Open this post in threaded view
|

Re: HTTP Status 404 - There is no Action mapped for namespace / and action name

Yazii
In reply to this post by dilini
namespace is added only for package tag
Reply | Threaded
Open this post in threaded view
|

Re: HTTP Status 404 - There is no Action mapped for namespace / and action name

Kushal
In reply to this post by dilini
<result name="success">Welcome.jsp</result>
<result name="error">login.jsp</result>

Above it should be /Welcome.jsp and /login.jsp

This should solve your problem.
Reply | Threaded
Open this post in threaded view
|

Re: HTTP Status 404 - There is no Action mapped for namespace / and action name

sankar.lp.gym
In reply to this post by dilini
Namespaces can added only to package tag.



Struts2 Training in chennai