Re: Configuration question

2021-02-22 Thread Tamás Barta
Hi,

My namespace was set to '/', if I remove it and use the default namespace
then it works well.

Regards, Tamás

On Mon, Feb 22, 2021 at 2:50 PM Dave Newton  wrote:

> Are you asking about default-action-ref?
>
> On Mon, Feb 22, 2021 at 08:28 Tamás Barta  wrote:
>
> > Hi,
> >
> > I would like Struts 2 to execute MyAction when there is no action mapping
> > for a path. So I set
> >
> > 
> >...
> > 
> >
> > 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 
> li: dave-newton 
> gh: davelnewton 
> so: Dave Newton 
> bl[0]: Bucky Bits 
> bl[1]: Maker's End Blog 
> sk: davelnewton_skype
>


Re: Configuration question

2021-02-22 Thread Dave Newton
Are you asking about default-action-ref?

On Mon, Feb 22, 2021 at 08:28 Tamás Barta  wrote:

> Hi,
>
> I would like Struts 2 to execute MyAction when there is no action mapping
> for a path. So I set
>
> 
>...
> 
>
> 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 
li: dave-newton 
gh: davelnewton 
so: Dave Newton 
bl[0]: Bucky Bits 
bl[1]: Maker's End Blog 
sk: davelnewton_skype


Configuration question

2021-02-22 Thread Tamás Barta
Hi,

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


   ...


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