Re: redirect page in the constructor

2008-06-30 Thread James Carman
On Mon, Jun 30, 2008 at 4:36 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > exceptions are for exceptional circumstances. i think redirecting to a > different page from a constructor of another page is pretty > exceptional...otherwise you wouldnt be in the constructor of the wrong > page :) +1. A

Re: redirect page in the constructor

2008-06-30 Thread Igor Vaynberg
exceptions are for exceptional circumstances. i think redirecting to a different page from a constructor of another page is pretty exceptional...otherwise you wouldnt be in the constructor of the wrong page :) -igor On Mon, Jun 30, 2008 at 12:14 PM, Bruno Borges <[EMAIL PROTECTED]> wrote: > I kno

Re: redirect page in the constructor

2008-06-30 Thread Eyal Golan
Igor, Yes it does work On Mon, Jun 30, 2008 at 6:23 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > does it work? > > -igor > > On Mon, Jun 30, 2008 at 2:28 AM, Eyal Golan <[EMAIL PROTECTED]> wrote: > > OK. > > That is what I did. > > So, if a instantiate a page and then put it as a parameter in t

Re: redirect page in the constructor

2008-06-30 Thread Bruno Borges
I know that Igor. In fact, I wasn't thinking really about performance here. I suggested the annotation because sounds more objective than throwing an exception. Exceptions are for errors or invalidations. Redirection is a flow control. No error in that. But, anyway... it was an idea... Ideas are

Re: redirect page in the constructor

2008-06-30 Thread Igor Vaynberg
On Mon, Jun 30, 2008 at 11:59 AM, Bruno Borges <[EMAIL PROTECTED]> wrote: > I have an idea that sounds crazy, but imho, is better then throwing an > exception (stack trace is a little bit expensive to the VM). right, because we dont care about performance :) /** * Immediately aborts any furthe

Re: redirect page in the constructor

2008-06-30 Thread James Carman
Sounds a bit too confusing to me. Seems overkill. On Mon, Jun 30, 2008 at 2:59 PM, Bruno Borges <[EMAIL PROTECTED]> wrote: > I have an idea that sounds crazy, but imho, is better then throwing an > exception (stack trace is a little bit expensive to the VM). > > Here it goes: > > public class

Re: redirect page in the constructor

2008-06-30 Thread Bruno Borges
I have an idea that sounds crazy, but imho, is better then throwing an exception (stack trace is a little bit expensive to the VM). Here it goes: public class MyPage extends WebPage { @Redirect(MyPageRedirector.class) public MyPage() { add(new Label("label", "Foo")); } public stat

Re: redirect page in the constructor

2008-06-30 Thread Igor Vaynberg
does it work? -igor On Mon, Jun 30, 2008 at 2:28 AM, Eyal Golan <[EMAIL PROTECTED]> wrote: > OK. > That is what I did. > So, if a instantiate a page and then put it as a parameter in the exception, > I am fine? > ... > TicketTreeQueuePage ticketTreeQueuePage = new > TicketTreeQueuePage(pageParame

Re: redirect page in the constructor

2008-06-30 Thread Eyal Golan
OK. That is what I did. So, if a instantiate a page and then put it as a parameter in the exception, I am fine? ... TicketTreeQueuePage ticketTreeQueuePage = new TicketTreeQueuePage(pageParameters); throw new RestartResponseAtInterceptPageException(ticketTreeQueuePage); Thanks On Wed, Jun 25, 2

Re: redirect page in the constructor

2008-06-29 Thread Martijn Dashorst
ROFLOL On Sun, Jun 29, 2008 at 11:59 PM, Matthijs Wensveen <[EMAIL PROTECTED]> wrote: > System.exit(0); > > Igor Vaynberg wrote: >> >> if you can find another way to abort creation of a class instance in >> java feel free to let us know. >> >> -igor >> >> On Thu, Jun 26, 2008 at 4:29 AM, Eyal Gola

Re: redirect page in the constructor

2008-06-29 Thread Matthijs Wensveen
System.exit(0); Igor Vaynberg wrote: if you can find another way to abort creation of a class instance in java feel free to let us know. -igor On Thu, Jun 26, 2008 at 4:29 AM, Eyal Golan <[EMAIL PROTECTED]> wrote: Igor, That is what we used before. Then I looked on the links above, tried t

Re: redirect page in the constructor

2008-06-26 Thread Igor Vaynberg
if you can find another way to abort creation of a class instance in java feel free to let us know. -igor On Thu, Jun 26, 2008 at 4:29 AM, Eyal Golan <[EMAIL PROTECTED]> wrote: > Igor, > That is what we used before. > Then I looked on the links above, tried the setResponsePage and found out > tha

Re: redirect page in the constructor

2008-06-26 Thread Eyal Golan
Igor, That is what we used before. Then I looked on the links above, tried the setResponsePage and found out that it works. After your answer, I understand that it does pollute the page map. I'll change to use the Exception instead. IMHO it's not a "nice" way to implement such a feature. On Wed,

Re: redirect page in the constructor

2008-06-25 Thread Igor Vaynberg
use restartresponseexception instead -igor On Wed, Jun 25, 2008 at 5:36 AM, Eyal Golan <[EMAIL PROTECTED]> wrote: > Hi, > After reviewing some discussion regarding the issue. > http://issues.apache.org/jira/browse/WICKET-696 > > and > http://www.mail-archive.com/[EMAIL PROTECTED]/msg30288.html >

redirect page in the constructor

2008-06-25 Thread Eyal Golan
Hi, After reviewing some discussion regarding the issue. http://issues.apache.org/jira/browse/WICKET-696 and http://www.mail-archive.com/[EMAIL PROTECTED]/msg30288.html What is the conclusion? Is the original page being mapped or no? thanks -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrum