You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2014/02/20 10:30:14 UTC

Page implements IRedirectListener

Hi,

I have the following patch here:

-public abstract class Page extends MarkupContainer implements
IRedirectListener, IRequestablePage
+public abstract class Page extends MarkupContainer implements
IRequestablePage
 {
        /** True if the page hierarchy has been modified in the current
request. */
        private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
@@ -497,16 +497,6 @@ public abstract class Page extends MarkupContainer
implements IRedirectListener,
        }

        /**
-        * Redirect to this page.
-        *
-        * @see org.apache.wicket.IRedirectListener#onRedirect()
-        */
-       @Override
-       public final void onRedirect()
-       {
-       }
-


o.a.w.Page currently implements IRedirectListener but does nothing in
#onRedirect() and the method is final.
What is the idea here ? Maybe to forbid page specializations to use
IRedirectListener ?!

With my patch there are no other implementations of IRedirectListener, so
we can remove it completely. Can you imagine a use case when IRL is needed
?


Martin Grigorov
Wicket Training and Consulting

Re: Page implements IRedirectListener

Posted by Martin Grigorov <mg...@apache.org>.
https://issues.apache.org/jira/browse/WICKET-5513

Martin Grigorov
Wicket Training and Consulting


On Thu, Feb 20, 2014 at 2:16 PM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> I do agree
>
>
> On Thu, Feb 20, 2014 at 1:07 PM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > On Thu, Feb 20, 2014 at 2:02 PM, Ernesto Reinaldo Barreiro <
> > reiern70@gmail.com> wrote:
> >
> > > IMHO removing final would be the correct thing: this could be useful in
> > > case a user wants to do something on a page when they are redirected
> from
> > > another. Sample use case.
> > >
> > > 1- I have a (mounted) page with some functionality.  I have used this
> > page
> > > for some e-mail or some URL user keep..
> > > 2- I have created a new page that handles functionality. I want to
> > replace
> > > old page with RedirectPage pointing to new implementation.
> > > 3- On new page I want to display some info in case user arrives to the
> > page
> > > coming from old page (and only in that case).
> > >
> > > But I agree the above could also be achieve by "custom means"
> > >
> >
> > yes, you can either read the "Referrer" request header or you can pass
> > custom request parameter and use it in the NewPage's constructor
> > And this is more flexible than #onRedirect() because you will have the
> > control on the context information
> >
> >
> > >
> > >
> > >
> > > On Thu, Feb 20, 2014 at 11:58 AM, Sven Meier <sv...@meiers.net> wrote:
> > >
> > > > Since #onRedirect() is final currently, I'm +1 to remove
> > > IRedirectListener.
> > > >
> > > > Sven
> > > >
> > > >
> > > > On 02/20/2014 11:03 AM, Martin Grigorov wrote:
> > > >
> > > >> I've missed RedirectPage in my search the first time. Thanks!
> > > >>
> > > >> Here is a better version:
> > > >>
> > > >> diff --git
> > > >> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > > >> pages/RedirectPage.java
> > > >> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > > >> pages/RedirectPage.java
> > > >> index 9b60bea..57f6f1f 100644
> > > >> ---
> > > >> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > > >> pages/RedirectPage.java
> > > >> +++
> > > >> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > > >> pages/RedirectPage.java
> > > >> @@ -17,8 +17,9 @@
> > > >>   package org.apache.wicket.markup.html.pages;
> > > >>
> > > >>   import org.apache.wicket.AttributeModifier;
> > > >> -import org.apache.wicket.IRedirectListener;
> > > >>   import org.apache.wicket.Page;
> > > >> +import org.apache.wicket.core.request.handler.PageProvider;
> > > >> +import
> > org.apache.wicket.core.request.handler.RenderPageRequestHandler;
> > > >>   import org.apache.wicket.markup.html.WebMarkupContainer;
> > > >>   import org.apache.wicket.markup.html.WebPage;
> > > >>   import org.apache.wicket.model.Model;
> > > >> @@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
> > > >>          {
> > > >>                  final WebMarkupContainer redirect = new
> > > >> WebMarkupContainer("redirect");
> > > >>                  final String content = waitBeforeRedirectInSeconds
> +
> > > >> ";URL=" + url;
> > > >> -               redirect.add(new AttributeModifier("content", new
> > > >> Model<String>(content)));
> > > >> +               redirect.add(new AttributeModifier("content", new
> > > >> Model<>(content)));
> > > >>                  add(redirect);
> > > >>          }
> > > >>
> > > >> @@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
> > > >>           */
> > > >>          public RedirectPage(final Page page)
> > > >>          {
> > > >> -               this(page.urlFor(IRedirectListener.INTERFACE,
> > > >> page.getPageParameters()), 0);
> > > >> +               this(page, 0);
> > > >>          }
> > > >>
> > > >>          /**
> > > >> @@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
> > > >>           */
> > > >>          public RedirectPage(final Page page, final int
> > > >> waitBeforeRedirectInSeconds)
> > > >>          {
> > > >> -               this(page.urlFor(IRedirectListener.INTERFACE,
> > > >> page.getPageParameters()),
> > > >> +               this(page.urlFor(new RenderPageRequestHandler(new
> > > >> PageProvider(page))),
> > > >>                          waitBeforeRedirectInSeconds);
> > > >>          }
> > > >>
> > > >>
> > > >> I think it is better because it will create a "nice looking" url if
> > > there
> > > >> is #mountPage() for this page.
> > > >>
> > > >> Martin Grigorov
> > > >> Wicket Training and Consulting
> > > >>
> > > >>
> > > >> On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
> > > >> reiern70@gmail.com> wrote:
> > > >>
> > > >>  Martin,
> > > >>>
> > > >>> I cannot find where IRedirectListener#onRedirect is actually called
> > > >>> except
> > > >>> when page is visited via RedirectPage... So, to me is just a
> > marker...
> > > >>> Maybe making it not final might make sense as a page could do
> > something
> > > >>> when some other RedirectPage redirects to it?
> > > >>>
> > > >>>
> > > >>> On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <
> > > mgrigorov@apache.org
> > > >>>
> > > >>>> wrote:
> > > >>>> Hi,
> > > >>>>
> > > >>>> I have the following patch here:
> > > >>>>
> > > >>>> -public abstract class Page extends MarkupContainer implements
> > > >>>> IRedirectListener, IRequestablePage
> > > >>>> +public abstract class Page extends MarkupContainer implements
> > > >>>> IRequestablePage
> > > >>>>   {
> > > >>>>          /** True if the page hierarchy has been modified in the
> > > current
> > > >>>> request. */
> > > >>>>          private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
> > > >>>> @@ -497,16 +497,6 @@ public abstract class Page extends
> > > MarkupContainer
> > > >>>> implements IRedirectListener,
> > > >>>>          }
> > > >>>>
> > > >>>>          /**
> > > >>>> -        * Redirect to this page.
> > > >>>> -        *
> > > >>>> -        * @see org.apache.wicket.IRedirectListener#onRedirect()
> > > >>>> -        */
> > > >>>> -       @Override
> > > >>>> -       public final void onRedirect()
> > > >>>> -       {
> > > >>>> -       }
> > > >>>> -
> > > >>>>
> > > >>>>
> > > >>>> o.a.w.Page currently implements IRedirectListener but does nothing
> > in
> > > >>>> #onRedirect() and the method is final.
> > > >>>> What is the idea here ? Maybe to forbid page specializations to
> use
> > > >>>> IRedirectListener ?!
> > > >>>>
> > > >>>> With my patch there are no other implementations of
> > IRedirectListener,
> > > >>>> so
> > > >>>> we can remove it completely. Can you imagine a use case when IRL
> is
> > > >>>>
> > > >>> needed
> > > >>>
> > > >>>> ?
> > > >>>>
> > > >>>>
> > > >>>> Martin Grigorov
> > > >>>> Wicket Training and Consulting
> > > >>>>
> > > >>>>
> > > >>>
> > > >>> --
> > > >>> Regards - Ernesto Reinaldo Barreiro
> > > >>>
> > > >>>
> > > >
> > >
> > >
> > > --
> > > Regards - Ernesto Reinaldo Barreiro
> > >
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Re: Page implements IRedirectListener

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
I do agree


On Thu, Feb 20, 2014 at 1:07 PM, Martin Grigorov <mg...@apache.org>wrote:

> On Thu, Feb 20, 2014 at 2:02 PM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
> > IMHO removing final would be the correct thing: this could be useful in
> > case a user wants to do something on a page when they are redirected from
> > another. Sample use case.
> >
> > 1- I have a (mounted) page with some functionality.  I have used this
> page
> > for some e-mail or some URL user keep..
> > 2- I have created a new page that handles functionality. I want to
> replace
> > old page with RedirectPage pointing to new implementation.
> > 3- On new page I want to display some info in case user arrives to the
> page
> > coming from old page (and only in that case).
> >
> > But I agree the above could also be achieve by "custom means"
> >
>
> yes, you can either read the "Referrer" request header or you can pass
> custom request parameter and use it in the NewPage's constructor
> And this is more flexible than #onRedirect() because you will have the
> control on the context information
>
>
> >
> >
> >
> > On Thu, Feb 20, 2014 at 11:58 AM, Sven Meier <sv...@meiers.net> wrote:
> >
> > > Since #onRedirect() is final currently, I'm +1 to remove
> > IRedirectListener.
> > >
> > > Sven
> > >
> > >
> > > On 02/20/2014 11:03 AM, Martin Grigorov wrote:
> > >
> > >> I've missed RedirectPage in my search the first time. Thanks!
> > >>
> > >> Here is a better version:
> > >>
> > >> diff --git
> > >> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > >> pages/RedirectPage.java
> > >> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > >> pages/RedirectPage.java
> > >> index 9b60bea..57f6f1f 100644
> > >> ---
> > >> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > >> pages/RedirectPage.java
> > >> +++
> > >> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
> > >> pages/RedirectPage.java
> > >> @@ -17,8 +17,9 @@
> > >>   package org.apache.wicket.markup.html.pages;
> > >>
> > >>   import org.apache.wicket.AttributeModifier;
> > >> -import org.apache.wicket.IRedirectListener;
> > >>   import org.apache.wicket.Page;
> > >> +import org.apache.wicket.core.request.handler.PageProvider;
> > >> +import
> org.apache.wicket.core.request.handler.RenderPageRequestHandler;
> > >>   import org.apache.wicket.markup.html.WebMarkupContainer;
> > >>   import org.apache.wicket.markup.html.WebPage;
> > >>   import org.apache.wicket.model.Model;
> > >> @@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
> > >>          {
> > >>                  final WebMarkupContainer redirect = new
> > >> WebMarkupContainer("redirect");
> > >>                  final String content = waitBeforeRedirectInSeconds +
> > >> ";URL=" + url;
> > >> -               redirect.add(new AttributeModifier("content", new
> > >> Model<String>(content)));
> > >> +               redirect.add(new AttributeModifier("content", new
> > >> Model<>(content)));
> > >>                  add(redirect);
> > >>          }
> > >>
> > >> @@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
> > >>           */
> > >>          public RedirectPage(final Page page)
> > >>          {
> > >> -               this(page.urlFor(IRedirectListener.INTERFACE,
> > >> page.getPageParameters()), 0);
> > >> +               this(page, 0);
> > >>          }
> > >>
> > >>          /**
> > >> @@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
> > >>           */
> > >>          public RedirectPage(final Page page, final int
> > >> waitBeforeRedirectInSeconds)
> > >>          {
> > >> -               this(page.urlFor(IRedirectListener.INTERFACE,
> > >> page.getPageParameters()),
> > >> +               this(page.urlFor(new RenderPageRequestHandler(new
> > >> PageProvider(page))),
> > >>                          waitBeforeRedirectInSeconds);
> > >>          }
> > >>
> > >>
> > >> I think it is better because it will create a "nice looking" url if
> > there
> > >> is #mountPage() for this page.
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >>
> > >>
> > >> On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
> > >> reiern70@gmail.com> wrote:
> > >>
> > >>  Martin,
> > >>>
> > >>> I cannot find where IRedirectListener#onRedirect is actually called
> > >>> except
> > >>> when page is visited via RedirectPage... So, to me is just a
> marker...
> > >>> Maybe making it not final might make sense as a page could do
> something
> > >>> when some other RedirectPage redirects to it?
> > >>>
> > >>>
> > >>> On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <
> > mgrigorov@apache.org
> > >>>
> > >>>> wrote:
> > >>>> Hi,
> > >>>>
> > >>>> I have the following patch here:
> > >>>>
> > >>>> -public abstract class Page extends MarkupContainer implements
> > >>>> IRedirectListener, IRequestablePage
> > >>>> +public abstract class Page extends MarkupContainer implements
> > >>>> IRequestablePage
> > >>>>   {
> > >>>>          /** True if the page hierarchy has been modified in the
> > current
> > >>>> request. */
> > >>>>          private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
> > >>>> @@ -497,16 +497,6 @@ public abstract class Page extends
> > MarkupContainer
> > >>>> implements IRedirectListener,
> > >>>>          }
> > >>>>
> > >>>>          /**
> > >>>> -        * Redirect to this page.
> > >>>> -        *
> > >>>> -        * @see org.apache.wicket.IRedirectListener#onRedirect()
> > >>>> -        */
> > >>>> -       @Override
> > >>>> -       public final void onRedirect()
> > >>>> -       {
> > >>>> -       }
> > >>>> -
> > >>>>
> > >>>>
> > >>>> o.a.w.Page currently implements IRedirectListener but does nothing
> in
> > >>>> #onRedirect() and the method is final.
> > >>>> What is the idea here ? Maybe to forbid page specializations to use
> > >>>> IRedirectListener ?!
> > >>>>
> > >>>> With my patch there are no other implementations of
> IRedirectListener,
> > >>>> so
> > >>>> we can remove it completely. Can you imagine a use case when IRL is
> > >>>>
> > >>> needed
> > >>>
> > >>>> ?
> > >>>>
> > >>>>
> > >>>> Martin Grigorov
> > >>>> Wicket Training and Consulting
> > >>>>
> > >>>>
> > >>>
> > >>> --
> > >>> Regards - Ernesto Reinaldo Barreiro
> > >>>
> > >>>
> > >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: Page implements IRedirectListener

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Feb 20, 2014 at 2:02 PM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> IMHO removing final would be the correct thing: this could be useful in
> case a user wants to do something on a page when they are redirected from
> another. Sample use case.
>
> 1- I have a (mounted) page with some functionality.  I have used this page
> for some e-mail or some URL user keep..
> 2- I have created a new page that handles functionality. I want to replace
> old page with RedirectPage pointing to new implementation.
> 3- On new page I want to display some info in case user arrives to the page
> coming from old page (and only in that case).
>
> But I agree the above could also be achieve by "custom means"
>

yes, you can either read the "Referrer" request header or you can pass
custom request parameter and use it in the NewPage's constructor
And this is more flexible than #onRedirect() because you will have the
control on the context information


>
>
>
> On Thu, Feb 20, 2014 at 11:58 AM, Sven Meier <sv...@meiers.net> wrote:
>
> > Since #onRedirect() is final currently, I'm +1 to remove
> IRedirectListener.
> >
> > Sven
> >
> >
> > On 02/20/2014 11:03 AM, Martin Grigorov wrote:
> >
> >> I've missed RedirectPage in my search the first time. Thanks!
> >>
> >> Here is a better version:
> >>
> >> diff --git
> >> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
> >> pages/RedirectPage.java
> >> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
> >> pages/RedirectPage.java
> >> index 9b60bea..57f6f1f 100644
> >> ---
> >> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
> >> pages/RedirectPage.java
> >> +++
> >> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
> >> pages/RedirectPage.java
> >> @@ -17,8 +17,9 @@
> >>   package org.apache.wicket.markup.html.pages;
> >>
> >>   import org.apache.wicket.AttributeModifier;
> >> -import org.apache.wicket.IRedirectListener;
> >>   import org.apache.wicket.Page;
> >> +import org.apache.wicket.core.request.handler.PageProvider;
> >> +import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
> >>   import org.apache.wicket.markup.html.WebMarkupContainer;
> >>   import org.apache.wicket.markup.html.WebPage;
> >>   import org.apache.wicket.model.Model;
> >> @@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
> >>          {
> >>                  final WebMarkupContainer redirect = new
> >> WebMarkupContainer("redirect");
> >>                  final String content = waitBeforeRedirectInSeconds +
> >> ";URL=" + url;
> >> -               redirect.add(new AttributeModifier("content", new
> >> Model<String>(content)));
> >> +               redirect.add(new AttributeModifier("content", new
> >> Model<>(content)));
> >>                  add(redirect);
> >>          }
> >>
> >> @@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
> >>           */
> >>          public RedirectPage(final Page page)
> >>          {
> >> -               this(page.urlFor(IRedirectListener.INTERFACE,
> >> page.getPageParameters()), 0);
> >> +               this(page, 0);
> >>          }
> >>
> >>          /**
> >> @@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
> >>           */
> >>          public RedirectPage(final Page page, final int
> >> waitBeforeRedirectInSeconds)
> >>          {
> >> -               this(page.urlFor(IRedirectListener.INTERFACE,
> >> page.getPageParameters()),
> >> +               this(page.urlFor(new RenderPageRequestHandler(new
> >> PageProvider(page))),
> >>                          waitBeforeRedirectInSeconds);
> >>          }
> >>
> >>
> >> I think it is better because it will create a "nice looking" url if
> there
> >> is #mountPage() for this page.
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >>
> >>
> >> On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
> >> reiern70@gmail.com> wrote:
> >>
> >>  Martin,
> >>>
> >>> I cannot find where IRedirectListener#onRedirect is actually called
> >>> except
> >>> when page is visited via RedirectPage... So, to me is just a marker...
> >>> Maybe making it not final might make sense as a page could do something
> >>> when some other RedirectPage redirects to it?
> >>>
> >>>
> >>> On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <
> mgrigorov@apache.org
> >>>
> >>>> wrote:
> >>>> Hi,
> >>>>
> >>>> I have the following patch here:
> >>>>
> >>>> -public abstract class Page extends MarkupContainer implements
> >>>> IRedirectListener, IRequestablePage
> >>>> +public abstract class Page extends MarkupContainer implements
> >>>> IRequestablePage
> >>>>   {
> >>>>          /** True if the page hierarchy has been modified in the
> current
> >>>> request. */
> >>>>          private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
> >>>> @@ -497,16 +497,6 @@ public abstract class Page extends
> MarkupContainer
> >>>> implements IRedirectListener,
> >>>>          }
> >>>>
> >>>>          /**
> >>>> -        * Redirect to this page.
> >>>> -        *
> >>>> -        * @see org.apache.wicket.IRedirectListener#onRedirect()
> >>>> -        */
> >>>> -       @Override
> >>>> -       public final void onRedirect()
> >>>> -       {
> >>>> -       }
> >>>> -
> >>>>
> >>>>
> >>>> o.a.w.Page currently implements IRedirectListener but does nothing in
> >>>> #onRedirect() and the method is final.
> >>>> What is the idea here ? Maybe to forbid page specializations to use
> >>>> IRedirectListener ?!
> >>>>
> >>>> With my patch there are no other implementations of IRedirectListener,
> >>>> so
> >>>> we can remove it completely. Can you imagine a use case when IRL is
> >>>>
> >>> needed
> >>>
> >>>> ?
> >>>>
> >>>>
> >>>> Martin Grigorov
> >>>> Wicket Training and Consulting
> >>>>
> >>>>
> >>>
> >>> --
> >>> Regards - Ernesto Reinaldo Barreiro
> >>>
> >>>
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Re: Page implements IRedirectListener

Posted by Sven Meier <sv...@meiers.net>.
>But I agree the above could also be achieve by "custom means"

Exactly :)

Sven

On 02/20/2014 01:02 PM, Ernesto Reinaldo Barreiro wrote:
> IMHO removing final would be the correct thing: this could be useful in
> case a user wants to do something on a page when they are redirected from
> another. Sample use case.
>
> 1- I have a (mounted) page with some functionality.  I have used this page
> for some e-mail or some URL user keep..
> 2- I have created a new page that handles functionality. I want to replace
> old page with RedirectPage pointing to new implementation.
> 3- On new page I want to display some info in case user arrives to the page
> coming from old page (and only in that case).
>
> But I agree the above could also be achieve by "custom means"
>
>
>
> On Thu, Feb 20, 2014 at 11:58 AM, Sven Meier <sv...@meiers.net> wrote:
>
>> Since #onRedirect() is final currently, I'm +1 to remove IRedirectListener.
>>
>> Sven
>>
>>
>> On 02/20/2014 11:03 AM, Martin Grigorov wrote:
>>
>>> I've missed RedirectPage in my search the first time. Thanks!
>>>
>>> Here is a better version:
>>>
>>> diff --git
>>> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
>>> pages/RedirectPage.java
>>> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
>>> pages/RedirectPage.java
>>> index 9b60bea..57f6f1f 100644
>>> ---
>>> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
>>> pages/RedirectPage.java
>>> +++
>>> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
>>> pages/RedirectPage.java
>>> @@ -17,8 +17,9 @@
>>>    package org.apache.wicket.markup.html.pages;
>>>
>>>    import org.apache.wicket.AttributeModifier;
>>> -import org.apache.wicket.IRedirectListener;
>>>    import org.apache.wicket.Page;
>>> +import org.apache.wicket.core.request.handler.PageProvider;
>>> +import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
>>>    import org.apache.wicket.markup.html.WebMarkupContainer;
>>>    import org.apache.wicket.markup.html.WebPage;
>>>    import org.apache.wicket.model.Model;
>>> @@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
>>>           {
>>>                   final WebMarkupContainer redirect = new
>>> WebMarkupContainer("redirect");
>>>                   final String content = waitBeforeRedirectInSeconds +
>>> ";URL=" + url;
>>> -               redirect.add(new AttributeModifier("content", new
>>> Model<String>(content)));
>>> +               redirect.add(new AttributeModifier("content", new
>>> Model<>(content)));
>>>                   add(redirect);
>>>           }
>>>
>>> @@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
>>>            */
>>>           public RedirectPage(final Page page)
>>>           {
>>> -               this(page.urlFor(IRedirectListener.INTERFACE,
>>> page.getPageParameters()), 0);
>>> +               this(page, 0);
>>>           }
>>>
>>>           /**
>>> @@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
>>>            */
>>>           public RedirectPage(final Page page, final int
>>> waitBeforeRedirectInSeconds)
>>>           {
>>> -               this(page.urlFor(IRedirectListener.INTERFACE,
>>> page.getPageParameters()),
>>> +               this(page.urlFor(new RenderPageRequestHandler(new
>>> PageProvider(page))),
>>>                           waitBeforeRedirectInSeconds);
>>>           }
>>>
>>>
>>> I think it is better because it will create a "nice looking" url if there
>>> is #mountPage() for this page.
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>>
>>>
>>> On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
>>> reiern70@gmail.com> wrote:
>>>
>>>   Martin,
>>>> I cannot find where IRedirectListener#onRedirect is actually called
>>>> except
>>>> when page is visited via RedirectPage... So, to me is just a marker...
>>>> Maybe making it not final might make sense as a page could do something
>>>> when some other RedirectPage redirects to it?
>>>>
>>>>
>>>> On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <mgrigorov@apache.org
>>>>
>>>>> wrote:
>>>>> Hi,
>>>>>
>>>>> I have the following patch here:
>>>>>
>>>>> -public abstract class Page extends MarkupContainer implements
>>>>> IRedirectListener, IRequestablePage
>>>>> +public abstract class Page extends MarkupContainer implements
>>>>> IRequestablePage
>>>>>    {
>>>>>           /** True if the page hierarchy has been modified in the current
>>>>> request. */
>>>>>           private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
>>>>> @@ -497,16 +497,6 @@ public abstract class Page extends MarkupContainer
>>>>> implements IRedirectListener,
>>>>>           }
>>>>>
>>>>>           /**
>>>>> -        * Redirect to this page.
>>>>> -        *
>>>>> -        * @see org.apache.wicket.IRedirectListener#onRedirect()
>>>>> -        */
>>>>> -       @Override
>>>>> -       public final void onRedirect()
>>>>> -       {
>>>>> -       }
>>>>> -
>>>>>
>>>>>
>>>>> o.a.w.Page currently implements IRedirectListener but does nothing in
>>>>> #onRedirect() and the method is final.
>>>>> What is the idea here ? Maybe to forbid page specializations to use
>>>>> IRedirectListener ?!
>>>>>
>>>>> With my patch there are no other implementations of IRedirectListener,
>>>>> so
>>>>> we can remove it completely. Can you imagine a use case when IRL is
>>>>>
>>>> needed
>>>>
>>>>> ?
>>>>>
>>>>>
>>>>> Martin Grigorov
>>>>> Wicket Training and Consulting
>>>>>
>>>>>
>>>> --
>>>> Regards - Ernesto Reinaldo Barreiro
>>>>
>>>>
>


Re: Page implements IRedirectListener

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
IMHO removing final would be the correct thing: this could be useful in
case a user wants to do something on a page when they are redirected from
another. Sample use case.

1- I have a (mounted) page with some functionality.  I have used this page
for some e-mail or some URL user keep..
2- I have created a new page that handles functionality. I want to replace
old page with RedirectPage pointing to new implementation.
3- On new page I want to display some info in case user arrives to the page
coming from old page (and only in that case).

But I agree the above could also be achieve by "custom means"



On Thu, Feb 20, 2014 at 11:58 AM, Sven Meier <sv...@meiers.net> wrote:

> Since #onRedirect() is final currently, I'm +1 to remove IRedirectListener.
>
> Sven
>
>
> On 02/20/2014 11:03 AM, Martin Grigorov wrote:
>
>> I've missed RedirectPage in my search the first time. Thanks!
>>
>> Here is a better version:
>>
>> diff --git
>> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
>> pages/RedirectPage.java
>> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
>> pages/RedirectPage.java
>> index 9b60bea..57f6f1f 100644
>> ---
>> i/wicket-core/src/main/java/org/apache/wicket/markup/html/
>> pages/RedirectPage.java
>> +++
>> w/wicket-core/src/main/java/org/apache/wicket/markup/html/
>> pages/RedirectPage.java
>> @@ -17,8 +17,9 @@
>>   package org.apache.wicket.markup.html.pages;
>>
>>   import org.apache.wicket.AttributeModifier;
>> -import org.apache.wicket.IRedirectListener;
>>   import org.apache.wicket.Page;
>> +import org.apache.wicket.core.request.handler.PageProvider;
>> +import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
>>   import org.apache.wicket.markup.html.WebMarkupContainer;
>>   import org.apache.wicket.markup.html.WebPage;
>>   import org.apache.wicket.model.Model;
>> @@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
>>          {
>>                  final WebMarkupContainer redirect = new
>> WebMarkupContainer("redirect");
>>                  final String content = waitBeforeRedirectInSeconds +
>> ";URL=" + url;
>> -               redirect.add(new AttributeModifier("content", new
>> Model<String>(content)));
>> +               redirect.add(new AttributeModifier("content", new
>> Model<>(content)));
>>                  add(redirect);
>>          }
>>
>> @@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
>>           */
>>          public RedirectPage(final Page page)
>>          {
>> -               this(page.urlFor(IRedirectListener.INTERFACE,
>> page.getPageParameters()), 0);
>> +               this(page, 0);
>>          }
>>
>>          /**
>> @@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
>>           */
>>          public RedirectPage(final Page page, final int
>> waitBeforeRedirectInSeconds)
>>          {
>> -               this(page.urlFor(IRedirectListener.INTERFACE,
>> page.getPageParameters()),
>> +               this(page.urlFor(new RenderPageRequestHandler(new
>> PageProvider(page))),
>>                          waitBeforeRedirectInSeconds);
>>          }
>>
>>
>> I think it is better because it will create a "nice looking" url if there
>> is #mountPage() for this page.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>>
>>
>> On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
>> reiern70@gmail.com> wrote:
>>
>>  Martin,
>>>
>>> I cannot find where IRedirectListener#onRedirect is actually called
>>> except
>>> when page is visited via RedirectPage... So, to me is just a marker...
>>> Maybe making it not final might make sense as a page could do something
>>> when some other RedirectPage redirects to it?
>>>
>>>
>>> On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <mgrigorov@apache.org
>>>
>>>> wrote:
>>>> Hi,
>>>>
>>>> I have the following patch here:
>>>>
>>>> -public abstract class Page extends MarkupContainer implements
>>>> IRedirectListener, IRequestablePage
>>>> +public abstract class Page extends MarkupContainer implements
>>>> IRequestablePage
>>>>   {
>>>>          /** True if the page hierarchy has been modified in the current
>>>> request. */
>>>>          private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
>>>> @@ -497,16 +497,6 @@ public abstract class Page extends MarkupContainer
>>>> implements IRedirectListener,
>>>>          }
>>>>
>>>>          /**
>>>> -        * Redirect to this page.
>>>> -        *
>>>> -        * @see org.apache.wicket.IRedirectListener#onRedirect()
>>>> -        */
>>>> -       @Override
>>>> -       public final void onRedirect()
>>>> -       {
>>>> -       }
>>>> -
>>>>
>>>>
>>>> o.a.w.Page currently implements IRedirectListener but does nothing in
>>>> #onRedirect() and the method is final.
>>>> What is the idea here ? Maybe to forbid page specializations to use
>>>> IRedirectListener ?!
>>>>
>>>> With my patch there are no other implementations of IRedirectListener,
>>>> so
>>>> we can remove it completely. Can you imagine a use case when IRL is
>>>>
>>> needed
>>>
>>>> ?
>>>>
>>>>
>>>> Martin Grigorov
>>>> Wicket Training and Consulting
>>>>
>>>>
>>>
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
>>>
>>>
>


-- 
Regards - Ernesto Reinaldo Barreiro

Re: Page implements IRedirectListener

Posted by Sven Meier <sv...@meiers.net>.
Since #onRedirect() is final currently, I'm +1 to remove IRedirectListener.

Sven

On 02/20/2014 11:03 AM, Martin Grigorov wrote:
> I've missed RedirectPage in my search the first time. Thanks!
>
> Here is a better version:
>
> diff --git
> i/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
> w/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
> index 9b60bea..57f6f1f 100644
> ---
> i/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
> +++
> w/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
> @@ -17,8 +17,9 @@
>   package org.apache.wicket.markup.html.pages;
>
>   import org.apache.wicket.AttributeModifier;
> -import org.apache.wicket.IRedirectListener;
>   import org.apache.wicket.Page;
> +import org.apache.wicket.core.request.handler.PageProvider;
> +import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
>   import org.apache.wicket.markup.html.WebMarkupContainer;
>   import org.apache.wicket.markup.html.WebPage;
>   import org.apache.wicket.model.Model;
> @@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
>          {
>                  final WebMarkupContainer redirect = new
> WebMarkupContainer("redirect");
>                  final String content = waitBeforeRedirectInSeconds +
> ";URL=" + url;
> -               redirect.add(new AttributeModifier("content", new
> Model<String>(content)));
> +               redirect.add(new AttributeModifier("content", new
> Model<>(content)));
>                  add(redirect);
>          }
>
> @@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
>           */
>          public RedirectPage(final Page page)
>          {
> -               this(page.urlFor(IRedirectListener.INTERFACE,
> page.getPageParameters()), 0);
> +               this(page, 0);
>          }
>
>          /**
> @@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
>           */
>          public RedirectPage(final Page page, final int
> waitBeforeRedirectInSeconds)
>          {
> -               this(page.urlFor(IRedirectListener.INTERFACE,
> page.getPageParameters()),
> +               this(page.urlFor(new RenderPageRequestHandler(new
> PageProvider(page))),
>                          waitBeforeRedirectInSeconds);
>          }
>
>
> I think it is better because it will create a "nice looking" url if there
> is #mountPage() for this page.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
>> Martin,
>>
>> I cannot find where IRedirectListener#onRedirect is actually called except
>> when page is visited via RedirectPage... So, to me is just a marker...
>> Maybe making it not final might make sense as a page could do something
>> when some other RedirectPage redirects to it?
>>
>>
>> On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <mgrigorov@apache.org
>>> wrote:
>>> Hi,
>>>
>>> I have the following patch here:
>>>
>>> -public abstract class Page extends MarkupContainer implements
>>> IRedirectListener, IRequestablePage
>>> +public abstract class Page extends MarkupContainer implements
>>> IRequestablePage
>>>   {
>>>          /** True if the page hierarchy has been modified in the current
>>> request. */
>>>          private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
>>> @@ -497,16 +497,6 @@ public abstract class Page extends MarkupContainer
>>> implements IRedirectListener,
>>>          }
>>>
>>>          /**
>>> -        * Redirect to this page.
>>> -        *
>>> -        * @see org.apache.wicket.IRedirectListener#onRedirect()
>>> -        */
>>> -       @Override
>>> -       public final void onRedirect()
>>> -       {
>>> -       }
>>> -
>>>
>>>
>>> o.a.w.Page currently implements IRedirectListener but does nothing in
>>> #onRedirect() and the method is final.
>>> What is the idea here ? Maybe to forbid page specializations to use
>>> IRedirectListener ?!
>>>
>>> With my patch there are no other implementations of IRedirectListener, so
>>> we can remove it completely. Can you imagine a use case when IRL is
>> needed
>>> ?
>>>
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>>
>>
>>
>> --
>> Regards - Ernesto Reinaldo Barreiro
>>


Re: Page implements IRedirectListener

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Martin,

Glad to be of some help. Also markup of RedirectPage.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:wicket="http://wicket.apache.org"><head><meta
wicket:id="redirect" http-equiv="refresh" content="0;
url=app"/></head></html>

might be "improved" to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:wicket="http://wicket.apache.org">
<head><meta wicket:id="redirect" http-equiv="refresh" content="0;
url=app"/></head>
<body>
    <wicket:child/>
</body>
</html>

So that redirect page can be sub classed without the need to copy and paste
header? Maybe also get rid of the final on Page? So, what one can actually
do something on onRedirect(). e.g display a popup "Welcome to our new way
of handling bla...." for users that get redirected to a page (and not show
it for user entering directly to the page). Maybe I can help and  cook a
little example for sample application.



On Thu, Feb 20, 2014 at 11:03 AM, Martin Grigorov <mg...@apache.org>wrote:

> I've missed RedirectPage in my search the first time. Thanks!
>
> Here is a better version:
>
> diff --git
>
> i/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
>
> w/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
> index 9b60bea..57f6f1f 100644
> ---
>
> i/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
> +++
>
> w/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
> @@ -17,8 +17,9 @@
>  package org.apache.wicket.markup.html.pages;
>
>  import org.apache.wicket.AttributeModifier;
> -import org.apache.wicket.IRedirectListener;
>  import org.apache.wicket.Page;
> +import org.apache.wicket.core.request.handler.PageProvider;
> +import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
>  import org.apache.wicket.markup.html.WebMarkupContainer;
>  import org.apache.wicket.markup.html.WebPage;
>  import org.apache.wicket.model.Model;
> @@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
>         {
>                 final WebMarkupContainer redirect = new
> WebMarkupContainer("redirect");
>                 final String content = waitBeforeRedirectInSeconds +
> ";URL=" + url;
> -               redirect.add(new AttributeModifier("content", new
> Model<String>(content)));
> +               redirect.add(new AttributeModifier("content", new
> Model<>(content)));
>                 add(redirect);
>         }
>
> @@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
>          */
>         public RedirectPage(final Page page)
>         {
> -               this(page.urlFor(IRedirectListener.INTERFACE,
> page.getPageParameters()), 0);
> +               this(page, 0);
>         }
>
>         /**
> @@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
>          */
>         public RedirectPage(final Page page, final int
> waitBeforeRedirectInSeconds)
>         {
> -               this(page.urlFor(IRedirectListener.INTERFACE,
> page.getPageParameters()),
> +               this(page.urlFor(new RenderPageRequestHandler(new
> PageProvider(page))),
>                         waitBeforeRedirectInSeconds);
>         }
>
>
> I think it is better because it will create a "nice looking" url if there
> is #mountPage() for this page.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
> > Martin,
> >
> > I cannot find where IRedirectListener#onRedirect is actually called
> except
> > when page is visited via RedirectPage... So, to me is just a marker...
> > Maybe making it not final might make sense as a page could do something
> > when some other RedirectPage redirects to it?
> >
> >
> > On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <mgrigorov@apache.org
> > >wrote:
> >
> > > Hi,
> > >
> > > I have the following patch here:
> > >
> > > -public abstract class Page extends MarkupContainer implements
> > > IRedirectListener, IRequestablePage
> > > +public abstract class Page extends MarkupContainer implements
> > > IRequestablePage
> > >  {
> > >         /** True if the page hierarchy has been modified in the current
> > > request. */
> > >         private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
> > > @@ -497,16 +497,6 @@ public abstract class Page extends MarkupContainer
> > > implements IRedirectListener,
> > >         }
> > >
> > >         /**
> > > -        * Redirect to this page.
> > > -        *
> > > -        * @see org.apache.wicket.IRedirectListener#onRedirect()
> > > -        */
> > > -       @Override
> > > -       public final void onRedirect()
> > > -       {
> > > -       }
> > > -
> > >
> > >
> > > o.a.w.Page currently implements IRedirectListener but does nothing in
> > > #onRedirect() and the method is final.
> > > What is the idea here ? Maybe to forbid page specializations to use
> > > IRedirectListener ?!
> > >
> > > With my patch there are no other implementations of IRedirectListener,
> so
> > > we can remove it completely. Can you imagine a use case when IRL is
> > needed
> > > ?
> > >
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > >
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: Page implements IRedirectListener

Posted by Martin Grigorov <mg...@apache.org>.
I've missed RedirectPage in my search the first time. Thanks!

Here is a better version:

diff --git
i/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
w/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
index 9b60bea..57f6f1f 100644
---
i/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
+++
w/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/RedirectPage.java
@@ -17,8 +17,9 @@
 package org.apache.wicket.markup.html.pages;

 import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.IRedirectListener;
 import org.apache.wicket.Page;
+import org.apache.wicket.core.request.handler.PageProvider;
+import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.model.Model;
@@ -57,7 +58,7 @@ public class RedirectPage extends WebPage
        {
                final WebMarkupContainer redirect = new
WebMarkupContainer("redirect");
                final String content = waitBeforeRedirectInSeconds +
";URL=" + url;
-               redirect.add(new AttributeModifier("content", new
Model<String>(content)));
+               redirect.add(new AttributeModifier("content", new
Model<>(content)));
                add(redirect);
        }

@@ -69,7 +70,7 @@ public class RedirectPage extends WebPage
         */
        public RedirectPage(final Page page)
        {
-               this(page.urlFor(IRedirectListener.INTERFACE,
page.getPageParameters()), 0);
+               this(page, 0);
        }

        /**
@@ -83,7 +84,7 @@ public class RedirectPage extends WebPage
         */
        public RedirectPage(final Page page, final int
waitBeforeRedirectInSeconds)
        {
-               this(page.urlFor(IRedirectListener.INTERFACE,
page.getPageParameters()),
+               this(page.urlFor(new RenderPageRequestHandler(new
PageProvider(page))),
                        waitBeforeRedirectInSeconds);
        }


I think it is better because it will create a "nice looking" url if there
is #mountPage() for this page.

Martin Grigorov
Wicket Training and Consulting


On Thu, Feb 20, 2014 at 11:52 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Martin,
>
> I cannot find where IRedirectListener#onRedirect is actually called except
> when page is visited via RedirectPage... So, to me is just a marker...
> Maybe making it not final might make sense as a page could do something
> when some other RedirectPage redirects to it?
>
>
> On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > Hi,
> >
> > I have the following patch here:
> >
> > -public abstract class Page extends MarkupContainer implements
> > IRedirectListener, IRequestablePage
> > +public abstract class Page extends MarkupContainer implements
> > IRequestablePage
> >  {
> >         /** True if the page hierarchy has been modified in the current
> > request. */
> >         private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
> > @@ -497,16 +497,6 @@ public abstract class Page extends MarkupContainer
> > implements IRedirectListener,
> >         }
> >
> >         /**
> > -        * Redirect to this page.
> > -        *
> > -        * @see org.apache.wicket.IRedirectListener#onRedirect()
> > -        */
> > -       @Override
> > -       public final void onRedirect()
> > -       {
> > -       }
> > -
> >
> >
> > o.a.w.Page currently implements IRedirectListener but does nothing in
> > #onRedirect() and the method is final.
> > What is the idea here ? Maybe to forbid page specializations to use
> > IRedirectListener ?!
> >
> > With my patch there are no other implementations of IRedirectListener, so
> > we can remove it completely. Can you imagine a use case when IRL is
> needed
> > ?
> >
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Re: Page implements IRedirectListener

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Martin,

I cannot find where IRedirectListener#onRedirect is actually called except
when page is visited via RedirectPage... So, to me is just a marker...
Maybe making it not final might make sense as a page could do something
when some other RedirectPage redirects to it?


On Thu, Feb 20, 2014 at 10:30 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> I have the following patch here:
>
> -public abstract class Page extends MarkupContainer implements
> IRedirectListener, IRequestablePage
> +public abstract class Page extends MarkupContainer implements
> IRequestablePage
>  {
>         /** True if the page hierarchy has been modified in the current
> request. */
>         private static final int FLAG_IS_DIRTY = FLAG_RESERVED3;
> @@ -497,16 +497,6 @@ public abstract class Page extends MarkupContainer
> implements IRedirectListener,
>         }
>
>         /**
> -        * Redirect to this page.
> -        *
> -        * @see org.apache.wicket.IRedirectListener#onRedirect()
> -        */
> -       @Override
> -       public final void onRedirect()
> -       {
> -       }
> -
>
>
> o.a.w.Page currently implements IRedirectListener but does nothing in
> #onRedirect() and the method is final.
> What is the idea here ? Maybe to forbid page specializations to use
> IRedirectListener ?!
>
> With my patch there are no other implementations of IRedirectListener, so
> we can remove it completely. Can you imagine a use case when IRL is needed
> ?
>
>
> Martin Grigorov
> Wicket Training and Consulting
>



-- 
Regards - Ernesto Reinaldo Barreiro