0
基於struts2 appfuse maven項目我試圖建立我個人的HelloWorld struts2 maven項目。歡迎文件標記似乎被忽略
我在pom.xml,web.xml和struts.xml文件中簡化了很多東西。因此,看起來<welcome-file-list>
和<welcome-file>
標籤沒有考慮到,當我點擊http://localhost:8080/時,我的文件index.jsp未加載。 出現下一個錯誤消息: 沒有爲命名空間/和操作名稱映射的操作。
(字「名稱」之後,是一個空白空間)
任何意見將不勝感激。
web.xml中:
<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>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
內的struts.xml:
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<action name="Menu">
<result>/menu/Menu.jsp</result>
</action>
</package>
你可以只顯示錯誤控制檯輸出 – 2011-03-25 11:03:27
#消息:\t沒有映射爲命名空間/和動作名稱動作。 堆棧跟蹤 沒有爲命名空間/和操作名稱映射的操作。 - [未知位置] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:178) – webmeiker 2011-03-25 11:45:30
好的。這意味着您的映射中存在一些問題,以及您在何處調用您的操作。可以向我們展示jsp文件從你調用動作的位置「菜單」 – 2011-03-25 11:48:50