Jam the data tool into the context.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1232 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
//
|
//
|
||||||
// $Id: DispatcherServlet.java,v 1.20 2003/09/18 23:52:17 mdb Exp $
|
// $Id: DispatcherServlet.java,v 1.21 2003/09/25 18:06:29 eric Exp $
|
||||||
//
|
//
|
||||||
// samskivert library - useful routines for java programs
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or modify it
|
// This library is free software; you can redistribute it and/or modify it
|
||||||
// under the terms of the GNU Lesser General Public License as published
|
// under the terms of the GNU Lesser General Public License as published
|
||||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||||
@@ -169,7 +169,7 @@ public class DispatcherServlet extends VelocityServlet
|
|||||||
Class appclass = Class.forName(appcl);
|
Class appclass = Class.forName(appcl);
|
||||||
_app = (Application)appclass.newInstance();
|
_app = (Application)appclass.newInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
// now initialize the applicaiton
|
// now initialize the applicaiton
|
||||||
String logicPkg = config.getInitParameter(LOGIC_PKG_KEY);
|
String logicPkg = config.getInitParameter(LOGIC_PKG_KEY);
|
||||||
_app.init(config, getServletContext(),
|
_app.init(config, getServletContext(),
|
||||||
@@ -288,6 +288,10 @@ public class DispatcherServlet extends VelocityServlet
|
|||||||
StringTool string = new StringTool();
|
StringTool string = new StringTool();
|
||||||
ictx.put(STRINGTOOL_KEY, string);
|
ictx.put(STRINGTOOL_KEY, string);
|
||||||
|
|
||||||
|
// create a new data tool for use by the tempate
|
||||||
|
DataTool datatool = new DataTool();
|
||||||
|
ictx.put(DATATOOL_KEY, datatool);
|
||||||
|
|
||||||
// resolve the appropriate logic class for this URI and
|
// resolve the appropriate logic class for this URI and
|
||||||
// execute it if it exists
|
// execute it if it exists
|
||||||
String path = req.getServletPath();
|
String path = req.getServletPath();
|
||||||
@@ -444,6 +448,9 @@ public class DispatcherServlet extends VelocityServlet
|
|||||||
/** The key used to store the string tool in the context. */
|
/** The key used to store the string tool in the context. */
|
||||||
protected static final String STRINGTOOL_KEY = "string";
|
protected static final String STRINGTOOL_KEY = "string";
|
||||||
|
|
||||||
|
/** The key used to store the data tool in the context. */
|
||||||
|
protected static final String DATATOOL_KEY = "data";
|
||||||
|
|
||||||
/** The servlet parameter key specifying the application class. */
|
/** The servlet parameter key specifying the application class. */
|
||||||
protected static final String APP_CLASS_KEY = "app_class";
|
protected static final String APP_CLASS_KEY = "app_class";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user