Re: Exception handling and testing

2012-09-27 Thread Martin Grigorov
Make the TabbedPanel stateless by using BookmarkablePageLink. P.S. Please start a new thread when you have new questions. On Wed, Sep 26, 2012 at 10:56 PM, Alec Swan alecs...@gmail.com wrote: Thanks, that worked as advertised. Now I am wondering if it's possible to get this to work when the

Re: Exception handling and testing

2012-09-27 Thread Alec Swan
Thanks, works great. I just needed to convert IRequestParameters to PageParameters in RequestHandler#onException() in order to remember the tab selection made by the user throughout login. Is there a convenience method somewhere in wicket to convert between IRequestParameters and PageParameters?

Re: Exception handling and testing

2012-09-26 Thread Martin Grigorov
You have to return a IRequestHandler. See RenderPageRequestHandler On Wed, Sep 26, 2012 at 1:45 AM, Alec Swan alecs...@gmail.com wrote: I am trying to implement Martin's @SubSite annotation approach to redirect the user to the sub-site's home page when AuthenticationException is thrown in

Re: Exception handling and testing

2012-09-26 Thread Alec Swan
Thanks, that worked as advertised. Now I am wondering if it's possible to get this to work when the user click on a tab in TabbedPanel? RenderPageRequestHandler(new PageProvider(HomePage.class), ALWAYS_REDIRECT) seems to lose the knowledge of the tab selected by the user and redirects the user to

Re: Exception handling and testing

2012-09-25 Thread Alec Swan
I am trying to implement Martin's @SubSite annotation approach to redirect the user to the sub-site's home page when AuthenticationException is thrown in Wicket 1.5. However, apparently I cannot throw a RestartResponseAtInterceptPageException(annotation.homePage()) from

Re: Exception handling and testing

2012-06-08 Thread Alec Swan
That's clever. I will give it a try. What is the recommendation on verifying that an exception was thrown during page rendering using Wicket tester? I am not talking just about authentication here, but exceptions in general. Thanks, Alec On Thu, Jun 7, 2012 at 6:18 PM, Martin Grigorov

Re: Exception handling and testing

2012-06-08 Thread Michal Margiel
2012/6/8 Alec Swan alecs...@gmail.com That's clever. I will give it a try. What is the recommendation on verifying that an exception was thrown during page rendering using Wicket tester? I am not talking just about authentication here, but exceptions in general. Hello, Why you want to

Re: Exception handling and testing

2012-06-08 Thread Alec Swan
I also use this approach, but with authentication exceptions thrown by Wicket it's hard to tell if the user was redirected to Login page because of authentication or some other exceptions. On Fri, Jun 8, 2012 at 1:15 PM, Michal Margiel michal.marg...@gmail.com wrote: 2012/6/8 Alec Swan

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

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,

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

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

Exception handling and testing

2012-06-06 Thread Alec Swan
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