Deal of the Day

Home » Main » Manning Forums » 2007 » Struts 2 in Action

Thread: There is no Action mapped for namespace / and action name in struts 2

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 5 - Pages: 1 - Last Post: Apr 23, 2011 6:02 AM by: franklinton.it
coolbuddy

Posts: 1
From: Malaysia
Registered: 8/5/09
There is no Action mapped for namespace / and action name in struts 2
Posted: Aug 5, 2009 3:53 AM
  Click to reply to this thread Reply

hi all,
i am new to struts 2 , i have created a sample helloworld application successfully. but i tried to launch new application for login module . i have created and deployed successfully. after i get the login page i gave username and password , and clicked login button, i got the following error message in Tomcat 6,

i have my package structure as follows

-src
--com.sample.action
---LoginAction.java
--Struts.xml
--web
---view
----login.jsp
----error.jsp
----success.jsp
---WEB-INF
---web.xml
---lib
---classes


following are the error i got in tomcat...

Aug 5, 2009 4:46:12 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: No configuration found for the specified action: '/doLogin' in namespace: '/view'. Form action defaulting to 'action' attribute's literal value.
Aug 5, 2009 4:46:13 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: No configuration found for the specified action: '/doLogin' in namespace: '/view'. Form action defaulting to 'action' attribute's literal value.
Aug 5, 2009 4:46:19 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find action or result
There is no Action mapped for namespace / and action name doLogin. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

chad.davis


Posts: 235
Registered: 3/1/06
Re: There is no Action mapped for namespace / and action name in struts 2
Posted: Aug 6, 2009 9:56 AM   in response to: coolbuddy in response to: coolbuddy
  Click to reply to this thread Reply

The error message is telling you that the action your URL is targetting doesn't exist in the mapping. So, we need to see your XML configuration.

chad.davis


Posts: 235
Registered: 3/1/06
Re: There is no Action mapped for namespace / and action name in struts 2
Posted: Aug 6, 2009 9:56 AM   in response to: chad.davis in response to: chad.davis
  Click to reply to this thread Reply

Also, where is this HelloWorld app from? The book? Did you make it? Please try to post more specific information when you have a question.

barvaliya

Posts: 1
From: rajot
Registered: 10/27/09
Re: There is no Action mapped for namespace / and action name in struts 2
Posted: Oct 27, 2009 11:45 AM   in response to: coolbuddy in response to: coolbuddy
  Click to reply to this thread Reply

i work in netbeans 6.0

i got the same error like
message--------There is no Action mapped for namespace / and action name login.
description-------The requested resource (There is no Action mapped for namespace / and action name login.) is not available.

my code for two mape file is here
login.jsp file
<s:form action="login" method="post">
and
struts.xml
<package name="hello" extends="struts-default" namespace="/hello">

<action name="login" class="hello.LoginAction">
<result name="success">/login_success.jsp</result>
<result name="error">/login.jsp</result>
<result name="input">/login.jsp</result>
</action>
</package>
so give me any help please for struts 2

oetzi

Posts: 54
From: Cologne
Registered: 1/30/09
Re: There is no Action mapped for namespace / and action name in struts 2
Posted: Nov 2, 2009 4:13 AM   in response to: barvaliya in response to: barvaliya
  Click to reply to this thread Reply

Hello barvaliya,

Your linking is faulty.

The error message tells you
"no Action mapped for namespace / and action name login"
The useful information is here: "namespace /" which means that you did not specify the namespace within your link.

But in your struts.xml you are using a namespace <-> package "<package name="hello..."

So your link must look something like this:
".../hello/login.action"

Greetings
oetzi>

franklinton.it

Posts: 1
Registered: 4/23/11
Re: There is no Action mapped for namespace / and action name in struts 2
Posted: Apr 23, 2011 6:02 AM   in response to: coolbuddy in response to: coolbuddy
  Click to reply to this thread Reply

Try out solution at -
http://franklintonit.blogspot.com/2011/04/error-on-browser-http-status-404-there.html

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor