RE: setResponsePage in the beggining of a constructor does not work

2010-02-05 Thread Chris Colman
Cool, thanks! That works fine.

 Just write this in WebApplication#init:
 getApplicationSettings().setPageExpiredErrorPage(PageExpiredError.class);
 This should solve your problem.
 
 Regards,
 Peter
 
 2010-02-05 00:59 keltezéssel, Chris Colman írta:
  Could I use RestartResponseException to redirect to a URL instead of a
 bookmarkable page?
 
  My problem is that all of my pages require a parameter (even the home
 page but that's fine because the Tomcat container server.xml configures
 the appropriate redirection for me - users never have to enter the
 parameters in the address bar) but the Expired Page page contains a link
 that does not contain any parameters.
 
  When a session expires the page that appears attempts to go to the
 'home' page without any parameters. If I could either change the expired
 page's link or do a redirect in the home page's constructor that
 redirect's to / then this would work fine.
 
  Unfortunately the RestartResponseException seems to only want to
 redirect to bookmarkable pages. Is there an alternative I could use to
 redirect to the / URL?
 
  -Original Message-
  From: Martin Asenov [mailto:mase...@velti.com]
  Sent: Friday, 5 February 2010 12:30 AM
  To: users@wicket.apache.org
  Subject: RE: setResponsePage in the beggining of a constructor does not
  work
 
  Thanks friend! Works great! You saved me a lot of time!
 
  Best regards,
  Martin
 
  -Original Message-
  From: Major Péter [mailto:majorpe...@sch.bme.hu]
  Sent: Thursday, February 04, 2010 3:21 PM
  To: users@wicket.apache.org
  Subject: Re: setResponsePage in the beggining of a constructor does not
  work
 
  Hi,
 
  the setresponsepage only marks, that the pagetarget is something else
 on
  the end of the cycle, but it isn't stopping the execution of the
 current
  page. If you want that, then use:
  throw new RestartResponseException(getApplication().getHomePage());
 
  Regards,
  Peter
 
  2010-02-04 14:16 keltezéssel, Martin Asenov írta:
  Hello guys!
 
  I've got three pages, where I do certain check in the beginning and if
  the criteria is not met, I redirect to home page. I make it that way:
 
  public MyPageClass {
 
  if (something) {
  system.out.println(mypageclass - we're in);
 
 setResponsePage(getApplication().getHomePage());
  }
 
   page initialization afterwards
  }
 
  The strange thing is that it works for one of the pages, for another
 two
  - it does not - there is no redirection at all; it goes on with further
  initializing. The criteria check block is the very same one in each of
 the
  pages.
 
  Appreciate if someone helps!
 
  Regards,
  Martin
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: setResponsePage in the beggining of a constructor does not work

2010-02-05 Thread Chris Colman
I tried that approach of looking around the tree but I must have missed
that Exception somehow. Looks like what I was after.

In the end the ExpiredPage solution worked out to be a good approach
because I got to create an ExpiredPage that's styled to the style of the
rest of the site.

 In Wicket it usually helps to look at the classes that are near in the
 class hierarchy. In this case RestartResponseException extends from
 AbstractRestartResponseException. Another subclass of
 AbstractRestartResponseException is RedirectToUrlException, which does
 exactly what you ask.
 
 Regards,
 Erik.
 
 Chris Colman wrote:
  Could I use RestartResponseException to redirect to a URL instead of
a
 bookmarkable page?
 
  My problem is that all of my pages require a parameter (even the
home
 page but that's fine because the Tomcat container server.xml
configures
 the appropriate redirection for me - users never have to enter the
 parameters in the address bar) but the Expired Page page contains a
link
 that does not contain any parameters.
 
  When a session expires the page that appears attempts to go to the
 'home' page without any parameters. If I could either change the
expired
 page's link or do a redirect in the home page's constructor that
 redirect's to / then this would work fine.
 
  Unfortunately the RestartResponseException seems to only want to
 redirect to bookmarkable pages. Is there an alternative I could use to
 redirect to the / URL?
 
 
 --
 Send from my SMTP compliant software
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



setResponsePage in the beggining of a constructor does not work

2010-02-04 Thread Martin Asenov
Hello guys!

I've got three pages, where I do certain check in the beginning and if the 
criteria is not met, I redirect to home page. I make it that way:

public MyPageClass {

if (something) {
system.out.println(mypageclass - we're in);
setResponsePage(getApplication().getHomePage());
}

 page initialization afterwards
}

The strange thing is that it works for one of the pages, for another two - it 
does not - there is no redirection at all; it goes on with further 
initializing. The criteria check block is the very same one in each of the 
pages.

Appreciate if someone helps!

Regards,
Martin


Re: setResponsePage in the beggining of a constructor does not work

2010-02-04 Thread Major Péter
Hi,

the setresponsepage only marks, that the pagetarget is something else on
the end of the cycle, but it isn't stopping the execution of the current
page. If you want that, then use:
throw new RestartResponseException(getApplication().getHomePage());

Regards,
Peter

2010-02-04 14:16 keltezéssel, Martin Asenov írta:
 Hello guys!
 
 I've got three pages, where I do certain check in the beginning and if the 
 criteria is not met, I redirect to home page. I make it that way:
 
 public MyPageClass {
 
 if (something) {
 system.out.println(mypageclass - we're in);
 setResponsePage(getApplication().getHomePage());
 }
 
  page initialization afterwards
 }
 
 The strange thing is that it works for one of the pages, for another two - it 
 does not - there is no redirection at all; it goes on with further 
 initializing. The criteria check block is the very same one in each of the 
 pages.
 
 Appreciate if someone helps!
 
 Regards,
 Martin

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: setResponsePage in the beggining of a constructor does not work

2010-02-04 Thread Martin Asenov
Thanks friend! Works great! You saved me a lot of time!

Best regards,
Martin

-Original Message-
From: Major Péter [mailto:majorpe...@sch.bme.hu] 
Sent: Thursday, February 04, 2010 3:21 PM
To: users@wicket.apache.org
Subject: Re: setResponsePage in the beggining of a constructor does not work

Hi,

the setresponsepage only marks, that the pagetarget is something else on
the end of the cycle, but it isn't stopping the execution of the current
page. If you want that, then use:
throw new RestartResponseException(getApplication().getHomePage());

Regards,
Peter

2010-02-04 14:16 keltezéssel, Martin Asenov írta:
 Hello guys!
 
 I've got three pages, where I do certain check in the beginning and if the 
 criteria is not met, I redirect to home page. I make it that way:
 
 public MyPageClass {
 
 if (something) {
 system.out.println(mypageclass - we're in);
 setResponsePage(getApplication().getHomePage());
 }
 
  page initialization afterwards
 }
 
 The strange thing is that it works for one of the pages, for another two - it 
 does not - there is no redirection at all; it goes on with further 
 initializing. The criteria check block is the very same one in each of the 
 pages.
 
 Appreciate if someone helps!
 
 Regards,
 Martin

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: setResponsePage in the beggining of a constructor does not work

2010-02-04 Thread Chris Colman
Could I use RestartResponseException to redirect to a URL instead of a 
bookmarkable page?

My problem is that all of my pages require a parameter (even the home page but 
that's fine because the Tomcat container server.xml configures the appropriate 
redirection for me - users never have to enter the parameters in the address 
bar) but the Expired Page page contains a link that does not contain any 
parameters.

When a session expires the page that appears attempts to go to the 'home' page 
without any parameters. If I could either change the expired page's link or do 
a redirect in the home page's constructor that redirect's to / then this 
would work fine.

Unfortunately the RestartResponseException seems to only want to redirect to 
bookmarkable pages. Is there an alternative I could use to redirect to the / 
URL?

 -Original Message-
 From: Martin Asenov [mailto:mase...@velti.com]
 Sent: Friday, 5 February 2010 12:30 AM
 To: users@wicket.apache.org
 Subject: RE: setResponsePage in the beggining of a constructor does not
 work
 
 Thanks friend! Works great! You saved me a lot of time!
 
 Best regards,
 Martin
 
 -Original Message-
 From: Major Péter [mailto:majorpe...@sch.bme.hu]
 Sent: Thursday, February 04, 2010 3:21 PM
 To: users@wicket.apache.org
 Subject: Re: setResponsePage in the beggining of a constructor does not
 work
 
 Hi,
 
 the setresponsepage only marks, that the pagetarget is something else on
 the end of the cycle, but it isn't stopping the execution of the current
 page. If you want that, then use:
 throw new RestartResponseException(getApplication().getHomePage());
 
 Regards,
 Peter
 
 2010-02-04 14:16 keltezéssel, Martin Asenov írta:
  Hello guys!
 
  I've got three pages, where I do certain check in the beginning and if
 the criteria is not met, I redirect to home page. I make it that way:
 
  public MyPageClass {
 
  if (something) {
  system.out.println(mypageclass - we're in);
  setResponsePage(getApplication().getHomePage());
  }
 
   page initialization afterwards
  }
 
  The strange thing is that it works for one of the pages, for another two
 - it does not - there is no redirection at all; it goes on with further
 initializing. The criteria check block is the very same one in each of the
 pages.
 
  Appreciate if someone helps!
 
  Regards,
  Martin
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: setResponsePage in the beggining of a constructor does not work

2010-02-04 Thread Major Péter
Just write this in WebApplication#init:
getApplicationSettings().setPageExpiredErrorPage(PageExpiredError.class);
This should solve your problem.

Regards,
Peter

2010-02-05 00:59 keltezéssel, Chris Colman írta:
 Could I use RestartResponseException to redirect to a URL instead of a 
 bookmarkable page?
 
 My problem is that all of my pages require a parameter (even the home page 
 but that's fine because the Tomcat container server.xml configures the 
 appropriate redirection for me - users never have to enter the parameters in 
 the address bar) but the Expired Page page contains a link that does not 
 contain any parameters.
 
 When a session expires the page that appears attempts to go to the 'home' 
 page without any parameters. If I could either change the expired page's link 
 or do a redirect in the home page's constructor that redirect's to / then 
 this would work fine.
 
 Unfortunately the RestartResponseException seems to only want to redirect to 
 bookmarkable pages. Is there an alternative I could use to redirect to the 
 / URL?
 
 -Original Message-
 From: Martin Asenov [mailto:mase...@velti.com]
 Sent: Friday, 5 February 2010 12:30 AM
 To: users@wicket.apache.org
 Subject: RE: setResponsePage in the beggining of a constructor does not
 work

 Thanks friend! Works great! You saved me a lot of time!

 Best regards,
 Martin

 -Original Message-
 From: Major Péter [mailto:majorpe...@sch.bme.hu]
 Sent: Thursday, February 04, 2010 3:21 PM
 To: users@wicket.apache.org
 Subject: Re: setResponsePage in the beggining of a constructor does not
 work

 Hi,

 the setresponsepage only marks, that the pagetarget is something else on
 the end of the cycle, but it isn't stopping the execution of the current
 page. If you want that, then use:
 throw new RestartResponseException(getApplication().getHomePage());

 Regards,
 Peter

 2010-02-04 14:16 keltezéssel, Martin Asenov írta:
 Hello guys!

 I've got three pages, where I do certain check in the beginning and if
 the criteria is not met, I redirect to home page. I make it that way:

 public MyPageClass {

 if (something) {
 system.out.println(mypageclass - we're in);
 setResponsePage(getApplication().getHomePage());
 }

  page initialization afterwards
 }

 The strange thing is that it works for one of the pages, for another two
 - it does not - there is no redirection at all; it goes on with further
 initializing. The criteria check block is the very same one in each of the
 pages.

 Appreciate if someone helps!

 Regards,
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: setResponsePage in the beggining of a constructor does not work

2010-02-04 Thread Steve Swinsburg
They don't need to be bookmarkable. You can call specific constructors of a 
class if you want:
throw new RestartResponseException(new MyClass(something));

cheers,
Steve


On 05/02/2010, at 10:59 AM, Chris Colman wrote:

 Could I use RestartResponseException to redirect to a URL instead of a 
 bookmarkable page?
 
 My problem is that all of my pages require a parameter (even the home page 
 but that's fine because the Tomcat container server.xml configures the 
 appropriate redirection for me - users never have to enter the parameters in 
 the address bar) but the Expired Page page contains a link that does not 
 contain any parameters.
 
 When a session expires the page that appears attempts to go to the 'home' 
 page without any parameters. If I could either change the expired page's link 
 or do a redirect in the home page's constructor that redirect's to / then 
 this would work fine.
 
 Unfortunately the RestartResponseException seems to only want to redirect to 
 bookmarkable pages. Is there an alternative I could use to redirect to the 
 / URL?
 
 -Original Message-
 From: Martin Asenov [mailto:mase...@velti.com]
 Sent: Friday, 5 February 2010 12:30 AM
 To: users@wicket.apache.org
 Subject: RE: setResponsePage in the beggining of a constructor does not
 work
 
 Thanks friend! Works great! You saved me a lot of time!
 
 Best regards,
 Martin
 
 -Original Message-
 From: Major Péter [mailto:majorpe...@sch.bme.hu]
 Sent: Thursday, February 04, 2010 3:21 PM
 To: users@wicket.apache.org
 Subject: Re: setResponsePage in the beggining of a constructor does not
 work
 
 Hi,
 
 the setresponsepage only marks, that the pagetarget is something else on
 the end of the cycle, but it isn't stopping the execution of the current
 page. If you want that, then use:
 throw new RestartResponseException(getApplication().getHomePage());
 
 Regards,
 Peter
 
 2010-02-04 14:16 keltezéssel, Martin Asenov írta:
 Hello guys!
 
 I've got three pages, where I do certain check in the beginning and if
 the criteria is not met, I redirect to home page. I make it that way:
 
 public MyPageClass {
 
if (something) {
system.out.println(mypageclass - we're in);
setResponsePage(getApplication().getHomePage());
}
 
  page initialization afterwards
 }
 
 The strange thing is that it works for one of the pages, for another two
 - it does not - there is no redirection at all; it goes on with further
 initializing. The criteria check block is the very same one in each of the
 pages.
 
 Appreciate if someone helps!
 
 Regards,
 Martin
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 



smime.p7s
Description: S/MIME cryptographic signature


Re: setResponsePage in the beggining of a constructor does not work

2010-02-04 Thread Erik van Oosten
In Wicket it usually helps to look at the classes that are near in the 
class hierarchy. In this case RestartResponseException extends from 
AbstractRestartResponseException. Another subclass of 
AbstractRestartResponseException is RedirectToUrlException, which does 
exactly what you ask.


Regards,
   Erik.

Chris Colman wrote:

Could I use RestartResponseException to redirect to a URL instead of a 
bookmarkable page?

My problem is that all of my pages require a parameter (even the home page but that's 
fine because the Tomcat container server.xml configures the appropriate redirection for 
me - users never have to enter the parameters in the address bar) but the Expired 
Page page contains a link that does not contain any parameters.

When a session expires the page that appears attempts to go to the 'home' page without 
any parameters. If I could either change the expired page's link or do a redirect in the 
home page's constructor that redirect's to / then this would work fine.

Unfortunately the RestartResponseException seems to only want to redirect to bookmarkable 
pages. Is there an alternative I could use to redirect to the / URL?
  


--
Send from my SMTP compliant software
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org