Re: Trying to migrate to 2.5.2

2016-09-19 Thread Tamás Barta
If devMode=false then our JBoss app server displays a similar 404 error
page with the same error message. I don't know what exactly happens in the
background but I would like to display a Struts action when page not found.

On Mon, Sep 19, 2016 at 1:25 PM, Lukasz Lenart 
wrote:

> 2016-09-19 13:24 GMT+02:00 Tamás Barta :
> > To avoid the "There is no Action mapped for namespace [/nosuchpackage]
> and
> > action name [nosuchaction] associated with context path []." pages.
> >
> > Dispatcher catches ConfigurationException and displays its default error
> > page.
>
> But this happens only in devMode I think.
>
>
> 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
>
>


Re: Trying to migrate to 2.5.2

2016-09-19 Thread Lukasz Lenart
2016-09-19 13:24 GMT+02:00 Tamás Barta :
> To avoid the "There is no Action mapped for namespace [/nosuchpackage] and
> action name [nosuchaction] associated with context path []." pages.
>
> Dispatcher catches ConfigurationException and displays its default error
> page.

But this happens only in devMode I think.


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



Re: Trying to migrate to 2.5.2

2016-09-19 Thread Tamás Barta
To avoid the "There is no Action mapped for namespace [/nosuchpackage] and
action name [nosuchaction] associated with context path []." pages.

Dispatcher catches ConfigurationException and displays its default error
page.

On Mon, Sep 19, 2016 at 1:17 PM, Lukasz Lenart 
wrote:

> 2016-09-19 13:08 GMT+02:00 Tamás Barta :
> > To answer my question and help others: I managed to handle every similar
> > problem by settings custom error handler:
> >
> >  > name="myHandler" class="mypackage.DispatcherErrorHandler" />
> > 
>
> Can you share more details? What was the reason as Struts provides
> default implementation.
>
>
> 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
>
>


Re: Trying to migrate to 2.5.2

2016-09-19 Thread Lukasz Lenart
2016-09-19 13:08 GMT+02:00 Tamás Barta :
> To answer my question and help others: I managed to handle every similar
> problem by settings custom error handler:
>
>  name="myHandler" class="mypackage.DispatcherErrorHandler" />
> 

Can you share more details? What was the reason as Struts provides
default implementation.


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



Re: Trying to migrate to 2.5.2

2016-09-19 Thread Tamás Barta
> It's a fallback, did you read this https://struts.apache.org/
docs/converting-application-from-codebehind-to-convention-plugin.html?

Yes, but I don't understand which row is about it :)

https://struts.apache.org/docs/namespace-configuration.html

The Default Namespace part which made me understand this problem.

On Mon, Sep 19, 2016 at 1:08 PM, Lukasz Lenart 
wrote:

> 2016-09-19 10:51 GMT+02:00 Tamás Barta :
> > Hi,
> >
> > Thank you for your answer. These two problems are very important for me
> on
> > my project.
> >
> >> Which action was returned?
> >
> > When I call http://myurl/anything/limit.action then LimitAction result
> is
> > returned. Any action in the main package can be accessed in any url, for
> > example:
> >
> > http://myurl/anything/limit.action
> > http://myurl/anything/anything/limit.action
> > http://myurl/a/b/c/limit.action
> >
> > I think it is not ok, is it?
>
> It's a fallback, did you read this
> https://struts.apache.org/docs/converting-application-
> from-codebehind-to-convention-plugin.html
> ?
>
> >
> >> Btw. the Convention plugin didn't change so much comparing to 2.3
> >
> > I didn't use Convention plugin in 2.3 but Codebehind. But now in 2.5 I
> have
> > to which case problems for me :(
>
> Uh... so it isn't 2.3 to 2.5 migration, but Codebehind to Convention
> migration ;-)
>
> >> You don't have to define an action in struts.xml just to satisfy
> 
> > - 's action name will be used to find action in
> > configuration (provided by the Convention plugin as well)
> >
> > How do you mean that? If I set this in struts.xml:
> >
> >   
>
> Just reference an action which is provided by the Convention e.g.
> 
>
> and you don't have to configure it in struts.xml
>
>
> 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
>
>


Re: Trying to migrate to 2.5.2

2016-09-19 Thread Tamás Barta
To answer my question and help others: I managed to handle every similar
problem by settings custom error handler:





On Mon, Sep 19, 2016 at 11:48 AM, Tamás Barta  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 :
>>
>> > 2016-09-19 9:59 GMT+02:00 Tamás Barta :
>> > > 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:
>> > >
>> > > 
>> > >
>> > > 
>> > > 
>> > > 
>> >
>> > You don't have to define an action in struts.xml just to satisfy
>> >  - '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
>> >
>> >
>>
>
>


Re: Trying to migrate to 2.5.2

2016-09-19 Thread Lukasz Lenart
2016-09-19 10:51 GMT+02:00 Tamás Barta :
> Hi,
>
> Thank you for your answer. These two problems are very important for me on
> my project.
>
>> Which action was returned?
>
> When I call http://myurl/anything/limit.action then LimitAction result is
> returned. Any action in the main package can be accessed in any url, for
> example:
>
> http://myurl/anything/limit.action
> http://myurl/anything/anything/limit.action
> http://myurl/a/b/c/limit.action
>
> I think it is not ok, is it?

It's a fallback, did you read this
https://struts.apache.org/docs/converting-application-from-codebehind-to-convention-plugin.html
?

>
>> Btw. the Convention plugin didn't change so much comparing to 2.3
>
> I didn't use Convention plugin in 2.3 but Codebehind. But now in 2.5 I have
> to which case problems for me :(

Uh... so it isn't 2.3 to 2.5 migration, but Codebehind to Convention
migration ;-)

>> You don't have to define an action in struts.xml just to satisfy 
>> 
> - 's action name will be used to find action in
> configuration (provided by the Convention plugin as well)
>
> How do you mean that? If I set this in struts.xml:
>
>   

Just reference an action which is provided by the Convention e.g.


and you don't have to configure it in struts.xml


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



Re: Trying to migrate to 2.5.2

2016-09-19 Thread Tamás Barta
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 :
>
> > 2016-09-19 9:59 GMT+02:00 Tamás Barta :
> > > 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:
> > >
> > > 
> > >
> > > 
> > > 
> > > 
> >
> > You don't have to define an action in struts.xml just to satisfy
> >  - '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
> >
> >
>


Re: Trying to migrate to 2.5.2

2016-09-19 Thread Tamás Barta
Hi,

Thank you for your answer. These two problems are very important for me on
my project.

> Which action was returned?

When I call http://myurl/anything/limit.action then LimitAction result is
returned. Any action in the main package can be accessed in any url, for
example:

http://myurl/anything/limit.action
http://myurl/anything/anything/limit.action
http://myurl/a/b/c/limit.action

I think it is not ok, is it?

> Btw. the Convention plugin didn't change so much comparing to 2.3

I didn't use Convention plugin in 2.3 but Codebehind. But now in 2.5 I have
to which case problems for me :(

> You don't have to define an action in struts.xml just to satisfy 
> 
- 's action name will be used to find action in
configuration (provided by the Convention plugin as well)

How do you mean that? If I set this in struts.xml:

  

Then it doesn't work.

Regards,
Tamas




On Mon, Sep 19, 2016 at 10:35 AM, Lukasz Lenart 
wrote:

> 2016-09-19 9:59 GMT+02:00 Tamás Barta :
> > 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:
> >
> > 
> >
> > 
> > 
> > 
>
> You don't have to define an action in struts.xml just to satisfy
>  - '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
>
>


Re: Trying to migrate to 2.5.2

2016-09-19 Thread Bruno Wintenberger
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 :

> 2016-09-19 9:59 GMT+02:00 Tamás Barta :
> > 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:
> >
> > 
> >
> > 
> > 
> > 
>
> You don't have to define an action in struts.xml just to satisfy
>  - '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
>
>


Re: Trying to migrate to 2.5.2

2016-09-19 Thread Lukasz Lenart
2016-09-19 9:59 GMT+02:00 Tamás Barta :
> 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:
>
> 
>
> 
> 
> 

You don't have to define an action in struts.xml just to satisfy
 - '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



Trying to migrate to 2.5.2

2016-09-19 Thread Tamás Barta
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 ...*

And if I set in default action in struts.xml:







Then

http://myurl/limit.action -> *got wrong an OtherAction is shown*

It seems then if I have default action then every action in main package
(mypackage.actions) is hidden by OtherAction but

http://myurl/anything/limit.action -> *still works which is wrong too*


Could you please help me to set default action without making actions in
main package wrong and fixing not to access actions in main package with
anyurl/*.action

Thanks,
Tamás