From: Eric B. R. <eb...@tc...> - 2002-11-25 05:28:52
|
On Friday, November 22, 2002, at 07:22 AM, Endre St=F8lsvik wrote: > Shouldn't the cranky-dude kick on _everything_?? I've spent some time looking at this, and I'm changing it, but the =20 "fix" has an interesting side effect when using the =20 DefaultEvaluationExceptionHandler. Currently, #if (b/c of Expression.java) treats all expressions that =20 throw as "false". When using CrankyEEH, this isn't good because you =20 miss the exceptions (as Endre reported). The solution is to make =20 Expression.java (and IfDirective) honor whatever EEH says to do. However, with Endre's examples, WM is throwing =20 PropertyException.NoSuchMethodException. This is an exception that =20 DefaultEEH also wants to throw. So, with this fix, CrankyEEH and =20 DefaultEEH both will throw when when you #if ($foo.noSuchMethod()), =20 whereas previously, because the exception was being treated as "false", =20= neither would throw. I think this is a GoodThing, but it's important to note because people =20= that rely on this behavior with #if/DefaultEEH (default configuration =20= of WM) will start getting exceptions where previously they did not. If =20= nothing else, at least now NoSuchMethodException is being handled =20 consistently. If anyone thinks this is bad, please yell. eric > > =46rom logfile: > > 12:41:58 PM broker DEBUG Property ExceptionHandler: > org.webmacro.engine.CrankyEvaluationExceptionHandler > > > But these bugs (in my template) does not write _anything_ in the =20 > output, > only makes my #if never give any sane results (until I checked the > logfile!) : > > > 12:54:09 PM engine WARNING Error evaluating $exceptions.size() > org.webmacro.PropertyException$NoSuchMethodException: No public method > size() on variable $exceptions of class =20 > org.webmacro.engine.UndefinedMacro > at =20 > /data/devel/endre/new/server/webapp/WEB-INF/classes/com/corelets/=20 > monitor/views/RenderExceptions.wm:2.2 > at =20 > = org.webmacro.engine.PropertyOperator.getProperty(PropertyOperatorCache.=20= > java:625) > at =20 > = org.webmacro.engine.PropertyOperatorCache.getProperty(PropertyOperatorC=20= > ache.java:142) > at org.webmacro.Context.internalGet(Context.java:389) > at org.webmacro.Context.getProperty(Context.java:441) > at =20 > = org.webmacro.engine.PropertyVariable.getValue(PropertyVariable.java:49) > at org.webmacro.engine.Variable.evaluate(Variable.java:148) > at =20 > = org.webmacro.engine.Expression$BinaryOperation.evaluate(Expression.java=20= > :93) > at =20 > org.webmacro.directive.IfDirective.write(IfDirective.java:191) > at org.webmacro.engine.Block.write(Block.java:135) > at org.webmacro.engine.WMTemplate.write(WMTemplate.java:255) > at =20 > = org.webmacro.directive.IncludeDirective.write(IncludeDirective.java:347=20= > ) > at org.webmacro.engine.Block.write(Block.java:166) > at org.webmacro.engine.WMTemplate.write(WMTemplate.java:255) > at org.webmacro.servlet.WMServlet.execute(WMServlet.java:524) > at = org.webmacro.servlet.WMServlet.doRequest(WMServlet.java:262) > at org.webmacro.servlet.WMServlet.doGet(WMServlet.java:195) > at = javax.servlet.http.HttpServlet.service(HttpServlet.java:740) > > > AND > > > 12:54:09 PM engine WARNING Error evaluating $task.LastRunStarted > org.webmacro.PropertyException$NoSuchPropertyException: No public =20 > property > LastRunStarted on variable $task of class > com.corelets.config.properties.TaskProperties at =20 > /data/devel/endre/new/server/webapp/WEB-INF/classes/com/corelets/=20 > monitor/views/Task.wm:55.15 > at =20 > = org.webmacro.engine.PropertyOperator.getProperty(PropertyOperatorCache.=20= > java:707) > at =20 > = org.webmacro.engine.PropertyOperatorCache.getProperty(PropertyOperatorC=20= > ache.java:142) > at org.webmacro.Context.internalGet(Context.java:389) > at org.webmacro.Context.getProperty(Context.java:441) > at =20 > = org.webmacro.engine.PropertyVariable.getValue(PropertyVariable.java:49) > at org.webmacro.engine.Variable.evaluate(Variable.java:148) > at =20 > = org.webmacro.engine.Expression$BinaryOperation.evaluate(Expression.java=20= > :93) > at =20 > org.webmacro.directive.IfDirective.write(IfDirective.java:191) > at org.webmacro.engine.Block.write(Block.java:166) > at org.webmacro.engine.WMTemplate.write(WMTemplate.java:255) > at org.webmacro.servlet.WMServlet.execute(WMServlet.java:524) > at = org.webmacro.servlet.WMServlet.doRequest(WMServlet.java:262) > at org.webmacro.servlet.WMServlet.doGet(WMServlet.java:195) > at = javax.servlet.http.HttpServlet.service(HttpServlet.java:740) > > > I was just looking for messed output, since I thought that Cranky-dude > would kick hugely on everything. But there wasn't _any_ signals = there.. > > > --=20 > Mvh, > Endre St=F8lsvik M[+47 93054050] F[+47 51625182] > Developer @ CoreTrek AS - http://www.coretrek.com/ > CoreTrek corporate portal / EIP - http://www.corelets.com/ > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user |