To answer my question and help others: I managed to handle every similar
problem by settings custom error handler:

    <bean type="org.apache.struts2.dispatcher.DispatcherErrorHandler"
name="myHandler" class="mypackage.DispatcherErrorHandler" />
    <constant name="struts.dispatcher.errorHandler" value="myHandler" />


On Mon, Sep 19, 2016 at 11:48 AM, Tamás Barta <bartata...@gmail.com> wrote:

> It seems that it solves both problems if I set @Namespace("/") in every
> action in the main package. The default "" namespace cause the problems.
>
> Now it seems that my only problem is that although I set
> "default-action-ref" it works if I call http://myurl/
> somethingnotexists.action
>
> But it won't work if I call http://myurl/anything/
> somethingnotexists.action the default 404 page appears:
> There is no Action mapped for namespace
> Why? How can I set a really default action?
>
>
> On Mon, Sep 19, 2016 at 10:50 AM, Bruno Wintenberger <
> bruno.wintenber...@gmail.com> wrote:
>
>> This make me think about the "struts.mapper.alwaysSelectFullNamespace"
>> property.
>> Take a look at this stackoverflow entry :
>> http://stackoverflow.com/questions/8424215/struts-2-mapped-
>> actions-working-with-any-url
>>
>> 2016-09-19 10:35 GMT+02:00 Lukasz Lenart <lukaszlen...@apache.org>:
>>
>> > 2016-09-19 9:59 GMT+02:00 Tamás Barta <bartata...@gmail.com>:
>> > > Hi,
>> > >
>> > > I'm trying to migrate from 2.3 to 2.5.2 but I have two weird problem,
>> > both
>> > > were good in 2.3 so they are maybe problem of Convention plugin.
>> > >
>> > > Let's assume I have two actions:
>> > >
>> > > mypackage.actions.LimitAction
>> > > mypackage.actions.user.UserAction
>> > >
>> > > In 2.3 :
>> > >
>> > > http://myurl/limit.action -> OK
>> > > http://myurl/anything/limit.action -> There is no Action ... which
>> is OK
>> > > http://myurl/limit.user/user.action -> OK
>> > >
>> > > In 2.5:
>> > >
>> > > http://myurl/anything/limit.action -> OK ... *which should be There
>> is
>> > no
>> > > Action ...*
>> >
>> > Which action was returned? There is a built-in mechanism in the
>> > Convention plugin to look for an "index" action in each package. Btw.
>> > the Convention plugin didn't change so much comparing to 2.3
>> >
>> > > And if I set in default action in struts.xml:
>> > >
>> > > <default-action-ref name="other" />
>> > >
>> > > <action name="other" class="mypackage.actions.OtherAction">
>> > > <result />
>> > > </action>
>> >
>> > You don't have to define an action in struts.xml just to satisfy
>> > <default-action-ref/> - <default-action-ref/>'s action name will be
>> > used to find action in configuration (provided by the Convention
>> > plugin as well)
>> >
>> >
>> > Regards
>> > --
>> > Łukasz
>> > + 48 606 323 122 http://www.lenart.org.pl/
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> >
>> >
>>
>
>

Reply via email to