yes this is also possible but i am not really into that.
It is to hidden it is something that is written somewhere in a manual how to do that. An interface makes it a bit more clear. And one finds it and its description in the javadoc.

For me setting the exception on a internal error page is more or less setting the model data of that page.

johan


Jonathan Locke wrote:

maybe the best thing would be to do a little reflection and call the constructor for InternalErrorPage subclass, passing in the exception. then you could make decisions about component state in your constructor based on what happened.

Jonathan Locke wrote:


in a user-facing app that's been deployed, the idea is you would never see a stack
trace.  you'd instead switch from

SHOW_EXCEPTION_PAGE

to

SHOW_INTERNAL_ERROR_PAGE

by calling ApplicationSettings.setUnexpectedExceptionDisplay(...).

you can change the "internal error" page (maybe a bad name, but it means "something
the user will understand and not an exception" via getPages()).
the configure() methods in ApplicationSettings do this automatically when
you change from "development" mode to "deployment" mode:

       if ("development".equalsIgnoreCase(configurationType))
       {
           setResourcePollFrequency(Duration.ONE_SECOND);
           setComponentUseCheck(true);
           setStripWicketTags(false);
           setUnexpectedExceptionDisplay(SHOW_EXCEPTION_PAGE);
       }
       else if ("deployment".equalsIgnoreCase(configurationType))
       {
           setComponentUseCheck(false);
           setStripWicketTags(true);
           setUnexpectedExceptionDisplay(SHOW_INTERNAL_ERROR_PAGE);
       }


Igor Vaynberg wrote:

The requestcycle has a template method that gets called on any uncaught
exception. Maybe a minor improvement to the current strategy is to create
more exception-specific classes as opposed to just using
WicketRuntimeException everywhere. That way you can diagnose wicket
internals better.

-Igor


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Phil Kulak
Sent: Thursday, August 11, 2005 4:11 PM
To: wicket-develop
Subject: [Wicket-develop] Let's talk about exceptions.

I didn't get much input on this when I was commenting in another's thread, so I thought I'd start a whole topic on it. Anyway, is it planned to give the developer some way to get at thrown exceptions in a central place and handle them? I keep coming on situations when I need to do this, and I have no idea how to go about it.

Some examples. You've got a shopping cart and a checkout process. You don't want the user to be able to start the checkout process with an empty cart. My first instinct is to check for an empty cart on construction and throw a custom exception if the cart's empty, but since I can't get to it further up the stack, that doesn't get me anywhere.

Or how about if I user tries to view a bookmarked page for an object that doesn't exist anymore? You can't draw the page without an object to draw from, so you throw an exception. It would be nice to then show the user some friendly message ("the object doesn't exist anymore..."), but currently your only options are a stack trace or a general exception message.

What are the thoughts on this?


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop








-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to