1 18 package shared; 19 20 import java.io.IOException ; 21 22 import org.apache.beehive.netui.pageflow.Forward; 23 import org.apache.beehive.netui.pageflow.PageFlowException; 24 import org.apache.beehive.netui.pageflow.SharedFlowController; 25 import org.apache.beehive.netui.pageflow.annotations.Jpf; 26 27 65 @Jpf.Controller( 66 catches={ 67 @Jpf.Catch(type=PageFlowException.class, method="handlePageFlowException"), 68 @Jpf.Catch(type=Exception .class, method="handleException") 69 } 70 ) 71 public class SharedFlow 72 extends SharedFlowController 73 { 74 @Jpf.ExceptionHandler( 75 forwards={ 76 @Jpf.Forward(name="errorPage", path="/resources/beehive/version1/jsps/error.jsp") 77 } 78 ) 79 protected Forward handleException(Exception ex, String actionName, String message, Object form) 80 { 81 System.err.print("[" + getRequest().getContextPath() + "] "); 82 System.err.println("Unhandled exception caught in shared flow " + getDisplayName() + ":"); 83 ex.printStackTrace(); 84 return new Forward("errorPage"); 85 } 86 87 95 @Jpf.ExceptionHandler 96 public Forward handlePageFlowException(PageFlowException ex, String actionName, String message, Object form) 97 throws IOException 98 { 99 ex.sendError(getRequest(), getResponse()); 100 return null; 101 } 102 } 103 | Popular Tags |