morgand 2003/01/25 15:13:14 Modified: jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell ScriptTag.java Log: converted beanshell taglib from Exception to JellyTagException Revision Changes Path 1.2 +19 -12 jakarta-commons-sandbox/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/ScriptTag.java Index: ScriptTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/ScriptTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ScriptTag.java 11 Jan 2003 13:27:27 -0000 1.1 +++ ScriptTag.java 25 Jan 2003 23:13:14 -0000 1.2 @@ -61,6 +61,9 @@ */ package org.apache.commons.jelly.tags.beanshell; +import bsh.EvalError; + +import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.TagSupport; import org.apache.commons.jelly.XMLOutput; @@ -78,13 +81,17 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(XMLOutput output) throws Exception { - JellyInterpreter interpreter = BeanShellExpressionFactory.getInterpreter(context); + public void doTag(XMLOutput output) throws JellyTagException { + try { + JellyInterpreter interpreter = BeanShellExpressionFactory.getInterpreter(context); - // @todo it'd be really nice to create a JellyNameSpace to pass into - // this method so that any variables declared by beanshell could be exported - // into the JellyContext - String text = getBodyText(); - interpreter.eval(text); + // @todo it'd be really nice to create a JellyNameSpace to pass into + // this method so that any variables declared by beanshell could be exported + // into the JellyContext + String text = getBodyText(); + interpreter.eval(text); + } catch (EvalError e) { + throw new JellyTagException(e); + } } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>