Re: Exception handling and testing

2012-06-07 Thread Martin Grigorov
Hi,

You can use IAuthenticationStrategy and throw
RestartResponseAtInterceptException.

On Wed, Jun 6, 2012 at 8:09 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 I am creating a new set of pages that are a part of an old project but
 have a different home page. It's kind of like a sub-site within a
 site. The user is required to log in on the sub-site's home page to be
 able to access any of those pages. If the user tries to access any of
 these pages directly he should be redirected to the sub-site's home
 page.

 What's the best way to implement/configure the home page for this sub-site?
 What kind of exception should each sub-site page throw to trigger
 redirection to home page?
 How can I verify that an exception was thrown in my test? (Currently I
 have a test which calls startPanel(..) which logs an exception if the
 user is not logged in, but returns with no errors. So, I have to
 verify that the rendered page is what it should be.)

 I am basically looking for best practices here.

 Thanks,

 Alec

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Redirect back to wicket page problem

2012-06-07 Thread jam.ntk
Hi, I am also seeing a similar issue.

Did you find a fix to this issue?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Redirect-back-to-wicket-page-problem-tp3433517p4649772.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Redirect back to wicket page problem

2012-06-07 Thread jam.ntk
Forgot to mention I am using  wicket 1.4.17 and IE 8

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Redirect-back-to-wicket-page-problem-tp3433517p4649773.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Exception handling and testing

2012-06-07 Thread Alec Swan
The problem is that I cannot verify this exception in tests. I am
basically asking for best practices.

Thanks!

On Thu, Jun 7, 2012 at 1:30 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 You can use IAuthenticationStrategy and throw
 RestartResponseAtInterceptException.

 On Wed, Jun 6, 2012 at 8:09 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 I am creating a new set of pages that are a part of an old project but
 have a different home page. It's kind of like a sub-site within a
 site. The user is required to log in on the sub-site's home page to be
 able to access any of those pages. If the user tries to access any of
 these pages directly he should be redirected to the sub-site's home
 page.

 What's the best way to implement/configure the home page for this sub-site?
 What kind of exception should each sub-site page throw to trigger
 redirection to home page?
 How can I verify that an exception was thrown in my test? (Currently I
 have a test which calls startPanel(..) which logs an exception if the
 user is not logged in, but returns with no errors. So, I have to
 verify that the rendered page is what it should be.)

 I am basically looking for best practices here.

 Thanks,

 Alec

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.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



Re: Exception handling and testing

2012-06-07 Thread Alec Swan
I am also asking how to redirect to sub-site's home page when the user
is not authenticated and tries to access on of those sub-site pages.

On Thu, Jun 7, 2012 at 3:35 PM, Alec Swan alecs...@gmail.com wrote:
 The problem is that I cannot verify this exception in tests. I am
 basically asking for best practices.

 Thanks!

 On Thu, Jun 7, 2012 at 1:30 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 You can use IAuthenticationStrategy and throw
 RestartResponseAtInterceptException.

 On Wed, Jun 6, 2012 at 8:09 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 I am creating a new set of pages that are a part of an old project but
 have a different home page. It's kind of like a sub-site within a
 site. The user is required to log in on the sub-site's home page to be
 able to access any of those pages. If the user tries to access any of
 these pages directly he should be redirected to the sub-site's home
 page.

 What's the best way to implement/configure the home page for this sub-site?
 What kind of exception should each sub-site page throw to trigger
 redirection to home page?
 How can I verify that an exception was thrown in my test? (Currently I
 have a test which calls startPanel(..) which logs an exception if the
 user is not logged in, but returns with no errors. So, I have to
 verify that the rendered page is what it should be.)

 I am basically looking for best practices here.

 Thanks,

 Alec

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.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



Re: Exception handling and testing

2012-06-07 Thread Martin Grigorov
On Fri, Jun 8, 2012 at 12:37 AM, Alec Swan alecs...@gmail.com wrote:
 I am also asking how to redirect to sub-site's home page when the user
 is not authenticated and tries to access on of those sub-site pages.

Use a custom IAuthenticationStrategy that knows which pages are part
of this sub-site (e.g. you can annotate them with a special @SubSite)
and
if the user is not logged in then redirect to @SubSite.homePage class.
This way even every page can it have its own home page.


 On Thu, Jun 7, 2012 at 3:35 PM, Alec Swan alecs...@gmail.com wrote:
 The problem is that I cannot verify this exception in tests. I am
 basically asking for best practices.

 Thanks!

 On Thu, Jun 7, 2012 at 1:30 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 You can use IAuthenticationStrategy and throw
 RestartResponseAtInterceptException.

 On Wed, Jun 6, 2012 at 8:09 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 I am creating a new set of pages that are a part of an old project but
 have a different home page. It's kind of like a sub-site within a
 site. The user is required to log in on the sub-site's home page to be
 able to access any of those pages. If the user tries to access any of
 these pages directly he should be redirected to the sub-site's home
 page.

 What's the best way to implement/configure the home page for this sub-site?
 What kind of exception should each sub-site page throw to trigger
 redirection to home page?
 How can I verify that an exception was thrown in my test? (Currently I
 have a test which calls startPanel(..) which logs an exception if the
 user is not logged in, but returns with no errors. So, I have to
 verify that the rendered page is what it should be.)

 I am basically looking for best practices here.

 Thanks,

 Alec

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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