Are you asking about default-action-ref? On Mon, Feb 22, 2021 at 08:28 Tamás Barta <bartata...@gmail.com> wrote:
> 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 > -- em: davelnew...@gmail.com mo: 908-380-8699 tw: @dave_newton <https://twitter.com/dave_newton> li: dave-newton <https://www.linkedin.com/in/dave-newton/> gh: davelnewton <https://github.com/davelnewton> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton> bl[0]: Bucky Bits <http://buckybits.blogspot.com/> bl[1]: Maker's End Blog <https://blog.makersend.com> sk: davelnewton_skype