如果我删除.action我的 Struts2 应用程序中的扩展,我会遇到问题。我把这个放在我的struts.xml:
<constant
name="struts.action.extension"
value="" />
该应用程序可以正常工作,但在索引页面中除外。我有web.xml这个:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
当我访问时http://localhost/myApp/,我收到以下错误:
There is no Action mapped for namespace [/] and
action name [index.jsp] associated with context path [/myApp].
- [unknown location]
但是,如果我访问http://localhost/myApp/fooAction,我不会收到任何错误并且可以完美运行。
如果我将扩展名更改为非空扩展名(如"html"),如果我访问http://localhost/myApp/.
那么,我在做什么有问题吗?为什么我在删除扩展程序时会收到此错误?有没有可能的方法不得到它?
编辑:如果我在错误中执行操作,<welcome-page>则错误如下:
There is no Action mapped for namespace [/] and action name []
associated with context path [/myApp].