You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sivacool <si...@gmail.com> on 2012/12/19 12:57:00 UTC

There is no Action mapped for namespace / and action name getTutorial. - [unknown location]


<http://struts.1045723.n5.nabble.com/file/n5711456/yzcu3ngv577fbopcv1l_ProjectStruture.png> 

*web.xml
*
<?xml version="1.0" encoding="UTF-8"?>  
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"   
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"   
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"   
id="WebApp_ID" version="3.0">  
  
  <display-name>Struts2Starter</display-name>  
      
  <filter>  
    <filter-name>struts2</filter-name>  
   
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>   
  </filter>  
  <filter-mapping>  
    <filter-name>struts2</filter-name>  
    <url-pattern>/*</url-pattern>  
  </filter-mapping>  
    
  <welcome-file-list>  
    <welcome-file>index.jsp</welcome-file>  
  </welcome-file-list>  
</web-app>  

*index.jsp
*
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"  
    pageEncoding="ISO-8859-1"%>  
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;>  
<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  
<title>Insert title here</title>  
</head>  
<body>  
<form action="./getTutorial.action">  
    Username: <input type="text" />  
    <input type="submit" value="Submit" />  
</form>  
</body>  
</html>  

*struts.xml
*
<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE struts PUBLIC &quot;-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN&quot;   
&quot;http://struts.apache.org/dtds/struts-2.0.dtd&quot;>  
  
<struts>  
    <package name="default" extends="struts-default">  
        <action name="getTutorial" class="com.test.TutorialAction">  
            <result name="success">/success.jsp</result>  
            <result name="failure">/failure.jsp</result>  
        </action>  
    </package>  
</struts>  

*TutorialAction.java
*
package com.test;  
  
public class TutorialAction {  
    public String execute()  
    {  
        System.out.println("Hello from execute");  
        return "success";  
    }  
}  



--
View this message in context: http://struts.1045723.n5.nabble.com/There-is-no-Action-mapped-for-namespace-and-action-name-getTutorial-unknown-location-tp5711456.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: There is no Action mapped for namespace / and action name getTutorial. - [unknown location]

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/20 sivacool <si...@gmail.com>:
> This is the url which i am trying to access the action class
>
> http://localhost:8080/StrutsStarter/getTutorial.action
>
> I am using Tomcat 7 and jdk 1.7 eclipse indigo is my IDE
>
> The following is the error i am getting on the console

Try to change the name of your action as I suggested early, used JDK5/6


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: There is no Action mapped for namespace / and action name getTutorial. - [unknown location]

Posted by sivacool <si...@gmail.com>.
This is the url which i am trying to access the action class

http://localhost:8080/StrutsStarter/getTutorial.action

I am using Tomcat 7 and jdk 1.7 eclipse indigo is my IDE

The following is the error i am getting on the console 

Dec 19, 2012 5:04:47 PM org.apache.struts2.dispatcher.Dispatcher
serviceAction
SEVERE: Could not find action or result
There is no Action mapped for namespace / and action name getTutorial. -
[unknown location]
	at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
	at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
	at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
	at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
	at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
	at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)





--
View this message in context: http://struts.1045723.n5.nabble.com/There-is-no-Action-mapped-for-namespace-and-action-name-getTutorial-unknown-location-tp5711456p5711473.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: There is no Action mapped for namespace / and action name getTutorial. - [unknown location]

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/20 sivacool <si...@gmail.com>:
> Is the problem with the old version of struts

Could you post url which you use to access the action?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: There is no Action mapped for namespace / and action name getTutorial. - [unknown location]

Posted by sivacool <si...@gmail.com>.
Is the problem with the old version of struts



--
View this message in context: http://struts.1045723.n5.nabble.com/There-is-no-Action-mapped-for-namespace-and-action-name-getTutorial-unknown-location-tp5711456p5711470.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: There is no Action mapped for namespace / and action name getTutorial. - [unknown location]

Posted by Lukasz Lenart <lu...@apache.org>.
Why you use so old version of Struts2? And getTutorial is a bad name
for an action, try to change it to get-tutorial or tutorial


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org