Allow an application to add things to the context before passing it on to
the logic. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1595 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user