diff --git a/projects/samskivert/src/java/com/samskivert/velocity/Application.java b/projects/samskivert/src/java/com/samskivert/velocity/Application.java index 1713f271..e565b6bb 100644 --- a/projects/samskivert/src/java/com/samskivert/velocity/Application.java +++ b/projects/samskivert/src/java/com/samskivert/velocity/Application.java @@ -164,6 +164,16 @@ public class Application { } + /** + * Allows derived aplication classes to prepare an invocation context + * prior to the logic class being invoked. They may wish to add + * standard tools to the context or do any other request-invariant + * preparation. + */ + protected void prepareContext (InvocationContext ctx) + { + } + /** * This should be overridden by the application implementation to * perform any necessary cleanup. diff --git a/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java b/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java index 63430737..c8b66aab 100644 --- a/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java +++ b/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java @@ -334,6 +334,9 @@ public class DispatcherServlet extends VelocityServlet CurrencyTool ctool = new CurrencyTool(req); ictx.put(CURRENCYTOOL_KEY, ctool); + // allow the application to prepare the context + _app.prepareContext(ictx); + // resolve the appropriate logic class for this URI and // execute it if it exists String path = req.getServletPath();