1

I have the following lines below in web.xml

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

But when I access http://localhost:8888 I received the error below:

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

Isn't it be redirected to index.jsp? How to make welcome file work?

Roman C
  • 49,761
  • 33
  • 66
  • 176
JR Galia
  • 17,229
  • 19
  • 92
  • 144

4 Answers4

1

After running server it is searching for an action. You should have an action in struts.xml that mapped to jsp file

Also add following in your web.xml

 <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
       org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
  </filter>
  <filter-mapping>
     <filter-name>struts2</filter-name>
     <url-pattern>/*</url-pattern>
  </filter-mapping>
xrcwrn
  • 5,339
  • 17
  • 68
  • 129
0

I think you have the welcome file configured properly. The error message looks like a struts error message. It looks like you have a struts configuration problem. Check your action class configuration in your struts.xml file.

iein valdez
  • 660
  • 4
  • 11
0

Please edit your struts.xml and enter this action as last action (only after all actions as a default action).

<action name="*">
    <result type="redirectAction">
    <param name="actionName">Home.action</param>
    </result>
</action>

Now this must be the last action and it will work like a default action for your application. You application will be redirected to this action if it didn't find any configured action.

Mikulas Dite
  • 7,790
  • 9
  • 59
  • 99
Knowledge Serve
  • 616
  • 7
  • 9
0

Add the below blank action to you struts.xml file in "/" package namespace and it will show the index.html when you will only try to access your url (like appid.app.com) and it will not show the error. Normally it will add a blank action and app engine will redirect the blank action to your welcome file.

    <action name="" class="com.candi.actions.Dashboard" method="noAction">
        <result name="success">index.jsp</result>
    </action>

let explain further. just add blank action by providing blank "" as your action name and redirect your result to index.php which will solve your problem.

Aniruddha Das
  • 20,520
  • 23
  • 96
  • 132