Alex Objelean wrote:
Can you be more specific? What kind of unexpected runtime exceptions are
you talking about? I don't think I understood you correctly.
It could be anything.. NPE (probably the most popular),
IllegalArgumentException and its descendants, ArithmeticException,
igor.vaynberg wrote:
i would hate a user to look at a signup form without a signup button
because something inside it caused an error.
i would also hate to see a user at a checkout page with a missing
$500.00 discount amount shown because there was an error in the
discount label.
aditsu wrote:
Anyway, I want to have the option to catch exceptions from child
components at certain points that I can define. And I think I got a new
idea.. involving replace and RestartResponseException
Well, it seems to work, except I had to call setAuto(true) on the
replacement
There are more threads about this issue...
In order to catch all runtime exception, you have to override default
RequestCycle (newRequestCycle method) in your application class and override
private Page handleRuntimeException(final Page page, final RuntimeException
e) method.
Alex Objelean
Ok, but how would that let me render the rest of the page?
Alex Objelean wrote:
There are more threads about this issue...
In order to catch all runtime exception, you have to override default
RequestCycle (newRequestCycle method) in your application class and
override
Thanks, but I can't find any handleRuntimeException method in any class. I'm
using wicket 1.4-m3.
Also, if the method is private, then how can I possibly override it?
Alex Objelean wrote:
There are more threads about this issue...
In order to catch all runtime exception, you have to
Sorry for mistake... I've updated the comment
aditsu wrote:
Thanks, but I can't find any handleRuntimeException method in any class.
I'm using wicket 1.4-m3.
Also, if the method is private, then how can I possibly override it?
Alex Objelean wrote:
There are more threads about this
It won't. I think you have to dig deeper into the request rendering.
Perhaps that overriding MarkupContainer#renderAll on all your Panels
that have expected exceptions will help.
But then again, exceptions are intended for controlling the
non-expected. You should not use exceptions for
If you return null in onRuntimeException - the stack trace will be shown.
But if you will return a page instance, the application will redirect you to
this page. For instance:
[CODE]
@Override
public Page onRuntimeException(final Page page, final RuntimeException
e) {
//do
Well, I'm specifically talking about unexpected runtime exceptions. I don't
want those to destroy the whole page.
They can kill a component, that's ok, but the rest of the page should work.
And yes I want to make sure that no exceptions are thrown, except that's
not so simple when you're dealing
Yeah, I was afraid it would come to that.
Sorry, you've apparently done some more research already...
Another thing I sometimes do is take the Wicket class and put it in the
web-project's classpath but with my changes (e.g. remove a final). All
servlet containers will load earlier from the
Can you be more specific? What kind of unexpected runtime exceptions are you
talking about? I don't think I understood you correctly.
Any runtime exception thrown by the wicket is caused by a programming
error... there is no sense to catch it without fixing the problem in your
code.
Catching
12 matches
Mail list logo