From: Chad B. <cwb...@us...> - 2008-05-28 15:10:18
|
User: cwbrandon Date: 08/05/28 08:10:25 Modified: andromda-jsf2/src/main/resources/templates/jsf2/controllers Controller.java.vsl Log: Make controller operations throw Throwable (so we don't have to worry about rethrowing exceptions and having them handled in the controller impl code) Revision Changes Path 1.15 +7 -2 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/Controller.java.vsl Index: Controller.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/Controller.java.vsl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -r1.14 -r1.15 --- Controller.java.vsl 16 May 2008 20:27:18 -0000 1.14 +++ Controller.java.vsl 28 May 2008 15:10:25 -0000 1.15 @@ -8,13 +8,16 @@ public abstract class $controller.name implements java.io.Serializable { + private static final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(${controller.name}.class); + static final String CONTROLLER_EXCEPTION = ${controller.name}.class.getName() + ".exception"; #foreach ($operation in $controller.operations) /** $operation.getDocumentation(" * ") */ - $operation.formSignature; + $operation.formSignature + throws java.lang.Throwable; #end @@ -90,8 +93,8 @@ this.setForm("$action.formKey", currentForm, false); this.addExceptionMessage(throwable); // - set the forward to null so that we stay on the current view - throwable.printStackTrace(); forward = null; + logger.error(throwable); } return forward; #end @@ -102,6 +105,7 @@ $actionState.getDocumentation(" * ") */ private java.lang.String ${actionState.actionMethodName}(#if (!$action.formFields.empty)final $action.fullyQualifiedFormImplementationName form#end) + throws java.lang.Throwable { java.lang.String forward = null; #if ($actionState.controllerCalls.empty) @@ -127,6 +131,7 @@ $decisionTransition.getDocumentation(" * ") */ private java.lang.String __${decisionTransition.operationCall.name}(#if (!$action.formFields.empty)final $action.fullyQualifiedFormImplementationName form#end) + throws java.lang.Throwable { final String value = java.lang.String.valueOf($decisionTransition.operationCall.formCall); #foreach ($outcome in $decisionTransition.target.outgoing) |