Re: [Wicket-user] Custom exception page
There is always the classic : getApplicationSettings ().setInternalErrorPage (MyCustomErrorPage.class); But that will not give you the exception thrown. On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Hi all, I am trying to make a custom exception page. I have created a class which overrides the onRuntimeException method in RequestCycle and wicket does not seem to be using. Do I need to tell it to use this class, somehow? Is there anything else I can do? Basically I need a custom error page which can display the exception being thrown. Thanks - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom exception page
Thank you for that but I also need to be able to display the original exception being thrown, so this method did not work for me. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc-Andre Houle Sent: Wednesday, January 24, 2007 10:02 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page There is always the classic : getApplicationSettings ().setInternalErrorPage (MyCustomErrorPage.class); But that will not give you the exception thrown. On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Hi all, I am trying to make a custom exception page. I have created a class which overrides the onRuntimeException method in RequestCycle and wicket does not seem to be using. Do I need to tell it to use this class, somehow? Is there anything else I can do? Basically I need a custom error page which can display the exception being thrown. Thanks - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom exception page
Thank you, I am working on this and making some progress. I am having trouble implementing the methods for getProcessor(), newClientInfo() and redirectTo() when I extend the RequestCycle. What should getProcessor and newClientInfo be returning? Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eelco Hillenius Sent: Wednesday, January 24, 2007 10:23 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page Override WebApplication#getDefaultRequestCycleFactory and provide the factory to create your custom request cycle. For instance: public class MyApplication extends WebApplication implements IRequestCycleFactory { protected IRequestCycleFactory getDefaultRequestCycleFactory() { return this; } public RequestCycle newRequestCycle(Session session, Request request, Response response) { return new MyRequestCycle(session, request, response); } ... where you let your application class be the factory. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Hi all, I am trying to make a custom exception page. I have created a class which overrides the onRuntimeException method in RequestCycle and wicket does not seem to be using. Do I need to tell it to use this class, somehow? Is there anything else I can do? Basically I need a custom error page which can display the exception being thrown. Thanks - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom exception page
That's where your custom request cycle comes in: override onRuntimeException in it and return the page you want, doing anything with the passed in exception you like. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Thank you for that but I also need to be able to display the original exception being thrown, so this method did not work for me. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc-Andre Houle Sent: Wednesday, January 24, 2007 10:02 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page There is always the classic : getApplicationSettings ().setInternalErrorPage (MyCustomErrorPage.class); But that will not give you the exception thrown. On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Hi all, I am trying to make a custom exception page. I have created a class which overrides the onRuntimeException method in RequestCycle and wicket does not seem to be using. Do I need to tell it to use this class, somehow? Is there anything else I can do? Basically I need a custom error page which can display the exception being thrown. Thanks - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom exception page
You should extend WebRequestCycle rather than RequestCycle. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Thank you, I am working on this and making some progress. I am having trouble implementing the methods for getProcessor(), newClientInfo() and redirectTo() when I extend the RequestCycle. What should getProcessor and newClientInfo be returning? Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eelco Hillenius Sent: Wednesday, January 24, 2007 10:23 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page Override WebApplication#getDefaultRequestCycleFactory and provide the factory to create your custom request cycle. For instance: public class MyApplication extends WebApplication implements IRequestCycleFactory { protected IRequestCycleFactory getDefaultRequestCycleFactory() { return this; } public RequestCycle newRequestCycle(Session session, Request request, Response response) { return new MyRequestCycle(session, request, response); } ... where you let your application class be the factory. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Hi all, I am trying to make a custom exception page. I have created a class which overrides the onRuntimeException method in RequestCycle and wicket does not seem to be using. Do I need to tell it to use this class, somehow? Is there anything else I can do? Basically I need a custom error page which can display the exception being thrown. Thanks - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom exception page
When I do this, does my application still need to implement IRequestCycleFactory? If so, how do I return my extended WebRequestCycle though I must be implementing newWebRequestCycle? If I sound confused on this, I certainly am, so thanks for your patience. What I have right now is extending WebRequestCycle and using that to override onRuntimeException. And in my extended application I am implementing IRequestCycleFactory. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eelco Hillenius Sent: Wednesday, January 24, 2007 11:06 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page You should extend WebRequestCycle rather than RequestCycle. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Thank you, I am working on this and making some progress. I am having trouble implementing the methods for getProcessor(), newClientInfo() and redirectTo() when I extend the RequestCycle. What should getProcessor and newClientInfo be returning? Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eelco Hillenius Sent: Wednesday, January 24, 2007 10:23 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page Override WebApplication#getDefaultRequestCycleFactory and provide the factory to create your custom request cycle. For instance: public class MyApplication extends WebApplication implements IRequestCycleFactory { protected IRequestCycleFactory getDefaultRequestCycleFactory() { return this; } public RequestCycle newRequestCycle(Session session, Request request, Response response) { return new MyRequestCycle(session, request, response); } ... where you let your application class be the factory. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Hi all, I am trying to make a custom exception page. I have created a class which overrides the onRuntimeException method in RequestCycle and wicket does not seem to be using. Do I need to tell it to use this class, somehow? Is there anything else I can do? Basically I need a custom error page which can display the exception being thrown. Thanks - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom exception page
What you do is let your application provide a request cycle *factory*. You do this by overriding method getDefaultRequestCycleFactory from Application. That method returns an instance of IRequestCycleFactory, which produces the custom request cycle. Now, to make life a little bit easier and avoid creating a separate class for this, we can just let your application class implement the IRequestCycleFactory interface, return itself in method getDefaultRequestCycleFactory. The newRequestCycle method is the factory method to create the custom request cycle instances. It will be called automatically if you follow this pattern. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: When I do this, does my application still need to implement IRequestCycleFactory? If so, how do I return my extended WebRequestCycle though I must be implementing newWebRequestCycle? If I sound confused on this, I certainly am, so thanks for your patience. What I have right now is extending WebRequestCycle and using that to override onRuntimeException. And in my extended application I am implementing IRequestCycleFactory. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eelco Hillenius Sent: Wednesday, January 24, 2007 11:06 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page You should extend WebRequestCycle rather than RequestCycle. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Thank you, I am working on this and making some progress. I am having trouble implementing the methods for getProcessor(), newClientInfo() and redirectTo() when I extend the RequestCycle. What should getProcessor and newClientInfo be returning? Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eelco Hillenius Sent: Wednesday, January 24, 2007 10:23 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Custom exception page Override WebApplication#getDefaultRequestCycleFactory and provide the factory to create your custom request cycle. For instance: public class MyApplication extends WebApplication implements IRequestCycleFactory { protected IRequestCycleFactory getDefaultRequestCycleFactory() { return this; } public RequestCycle newRequestCycle(Session session, Request request, Response response) { return new MyRequestCycle(session, request, response); } ... where you let your application class be the factory. Eelco On 1/24/07, Apaar Trivedi [EMAIL PROTECTED] wrote: Hi all, I am trying to make a custom exception page. I have created a class which overrides the onRuntimeException method in RequestCycle and wicket does not seem to be using. Do I need to tell it to use this class, somehow? Is there anything else I can do? Basically I need a custom error page which can display the exception being thrown. Thanks - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http