Why doesn't welcome-file-list work if I delete struts2.action extension?

I have a problem if I remove the extension .actioninside my Struts2 application. I put this in my struts.xml:

<constant
    name="struts.action.extension"
    value="" />

The application works correctly, except for the index page. In my mine web.xmlthis is:

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

When I access http://localhost/myApp/, I get the following error:

There is no Action mapped for namespace [/] and 
action name [index.jsp] associated with context path [/myApp]. 
- [unknown location]

However, if I get access to http://localhost/myApp/fooAction, I get no errors and it works fine.

If I change the extension for a non-empty extension (for example, "html"), I can clearly see the index page if I get access to http://localhost/myApp/.

So, is there something wrong with what I'm doing? Why am I getting this error when uninstalling an extension? Is there a possible way not to get it?

: <welcome-page>, :

There is no Action mapped for namespace [/] and action name [] 
associated with context path [/myApp].
+5
2

, index.jsp welcom.jsp <welcome-page>.

web.xml.

 <welcome-file-list>
            <welcome-file>index</welcome-file>
</welcome-file-list>

index - , , struts.xml

<action name="index" class="welcomeAction">
     <result>/ab.jsp</result>
 </action>

, , URL www.myapp.com/myApp, Struts2 init .

+8

, !!!!

<constant name="struts.action.extension" value=""/> 

struts.xml

<welcome-file>index.jsp</welcome-file> 

web.xml
struts.xml

<package name="default" extends="struts-default">
    <action name="index.jsp">
        <result>WEB-INF/login.jsp</result>
    </action>
</package>
+2

All Articles