Hi,

I would like Struts 2 to execute MyAction when there is no action mapping
for a path. So I set

<action name="*" class="MyAction">
   ...
</action>

in struts.xml.

When I request to url /foo or /foo.action, it works as expected, my Action
is executed without any exceptions. But when I request to /foo/foo.action
then my Action is executed too, but an error log appears:

14:21:38,375 ERROR [DispatcherErrorHandler] (default task-5/)
com.opensymphony.xwork2.config.ConfigurationException: There is no Action
mapped for namespace [/foo] and action name [foo] associated with context
path [].: There is no Action mapped for namespace [/foo] and action name
[foo] associated with context path []. - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:195)
[org.apache.struts-struts2-core-2.5.26.jar:2.5.26]
at
org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:57)
[org.apache.struts-struts2-core-2.5.26.jar:2.5.26]
at
org.apache.struts2.factory.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:32)
[org.apache.struts-struts2-core-2.5.26.jar:2.5.26]
at
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:60)
[org.apache.struts-struts2-core-2.5.26.jar:2.5.26]
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
[org.apache.struts-struts2-core-2.5.26.jar:2.5.26]
at
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
[org.apache.struts-struts2-core-2.5.26.jar:2.5.26]
at
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
[org.apache.struts-struts2-core-2.5.26.jar:2.5.26]
...

I would like to avoid this kind of ERROR log and handle /foo/foo.action the
same as /foo.action.
What should I do for that?

Thanks, Tamás

Reply via email to