01: /*
02: * Created on Nov 17, 2005
03: */
04: package uk.org.ponder.rsf.flow.errors;
05:
06: import uk.org.ponder.rsf.viewstate.AnyViewParameters;
07: import uk.org.ponder.rsf.viewstate.ViewParameters;
08:
09: /** The basic ViewExceptionStrategy which redirects to the determined default
10: * view in the case of any error. By default, this is mapped to the last
11: * position in the list of strategies and will handle all cases not
12: * handled by earlier registrations.
13: * @author Antranig Basman (antranig@caret.cam.ac.uk)
14: *
15: */
16: public class DefaultViewExceptionStrategy implements
17: ViewExceptionStrategy {
18: private AnyViewParameters defaultview;
19:
20: public void setDefaultView(ViewParameters defaultview) {
21: this .defaultview = defaultview;
22: }
23:
24: public AnyViewParameters handleException(Exception e,
25: ViewParameters incoming) {
26: return defaultview.get();
27: }
28:
29: }
|