From 2faba077fafbf3b995bcfafa6f613864d7250ae3 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 30 Oct 2002 17:43:16 +0000 Subject: [PATCH] Add request path elements to the macro handler dictionary in the response object. Plus a few minor additional cleanups. --- src/helma/framework/core/RequestEvaluator.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index 7241b186..900c9076 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -150,13 +150,15 @@ public final class RequestEvaluator implements Runnable { res.message = session.message; session.message = null; } + Map macroHandlers = res.getMacroHandlers (); try { if (error != null) { // there was an error in the previous loop, call error handler currentElement = root; - requestPath.add (currentElement); + // do not reset the requestPath so error handler can use the original one + // get error handler action String errorAction = app.props.getProperty ("error", "error"); action = getAction (currentElement, errorAction); if (action == null) @@ -165,6 +167,7 @@ public final class RequestEvaluator implements Runnable { } else if (req.path == null || "".equals (req.path.trim ())) { currentElement = root; requestPath.add (currentElement); + macroHandlers.put ("root", root); action = getAction (currentElement, null); if (action == null) throw new FrameworkException ("Action not found"); @@ -183,12 +186,16 @@ public final class RequestEvaluator implements Runnable { currentElement = root; requestPath.add (currentElement); + macroHandlers.put ("root", root); for (int i=0; i