我絕對是Struts2的初學者。我正在跟隨struts網站上的教程。我跟着this tutorial。我有一些麻煩。我在eclipse上創建了動態Web項目。然後我跟着教程。但是,當我運行的例子,我得到以下錯誤。Struts Hello world示例:沒有爲命名空間[/]和動作名稱錯誤映射的動作
There is no Action mapped for namespace [/] and action name [hello] associated with context path [/Hello_World_Struts_2]. - [unknown location]
我有以下目錄結構
而且我在struts.xml文件是
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="basicstruts2" extends="struts-default" namespace="/">
<action name="index">
<result>/index.jsp</result>
</action>
<action name="hello" class="org.apache.struts.helloworld.action.HelloWorldAction" method="execute">
<result name="SUCCESS">/HelloWorld.jsp</result>
</action>
</package>
</struts>
感謝您的答覆。
我試圖把它的代碼塊中,但我不能做到這一點。現在,我認爲沒關係。 – erencan