Commits

savaki  committed deb92fc

- removed the ToolboxContext as this duplicates functionality found in the #bean macro

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@246573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 2e5b374

Comments (0)

Files changed (3)

File src/java/com/opensymphony/webwork/default.properties

 ### Configuration reloading
 # This will cause the configuration to reload xwork.xml when it is changed
 webwork.configuration.xml.reload=false
+
+### Location of velocity.properties file.  defaults to velocity.properties
+#webwork.velocity.configfile = velocity.properties
+
+### Comma separated list of VelocityContext classnames to chain to the WebWorkVelocityContext
+#webwork.velocity.contexts =
+

File src/java/com/opensymphony/webwork/views/velocity/AbstractTagDirective.java

 
             // populate our tag with all the user specified properties
             if (object instanceof ParameterizedTag) {
-                ((ParameterizedTag) object).getParams().clear();
+                Map params = ((ParameterizedTag)object).getParams();
+                if( params != null ) {
+                    params.clear();
+                }
             }
 
             applyAttributes(contextAdapter, node, object);

File src/java/com/opensymphony/webwork/views/velocity/ToolContext.java

-package com.opensymphony.webwork.views.velocity;
-
-import org.apache.velocity.VelocityContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.Map;
-import java.util.Iterator;
-import java.util.HashMap;
-
-import com.opensymphony.webwork.config.Configuration;
-
-/**
- * @version $Id$
- * @author Matt Ho <a href="mailto:matt@enginegreen.com">&lt;matt@enginegreen.com&gt;</a>
- */
-public class ToolContext extends VelocityContext {
-    private static final Log log = LogFactory.getLog(VelocityManager.class);
-    final private String TOOL_PREFIX = "webwork.velocity.tool.";
-
-    Map toolMap = new HashMap();
-
-    public ToolContext() {
-        init();
-    }
-
-    protected void init() {
-        for (Iterator iterator = Configuration.list(); iterator.hasNext();) {
-            String key = iterator.next().toString();
-            if (key.startsWith(TOOL_PREFIX)) {
-                addTool(key.substring(TOOL_PREFIX.length()), Configuration.get(key).toString());
-            }
-        }
-    }
-
-    protected void addTool(String key, String classname) {
-        Object tool = null;
-        try {
-             tool = Class.forName(classname).newInstance();
-        } catch (Exception e) {
-            tool = classname;
-        }
-
-        log.info("Registering tool, " + classname + " [" + tool.getClass().getName() + "], as " + key);
-        toolMap.put(key, tool);
-    }
-
-    public boolean internalContainsKey(Object key) {
-        System.out.println("checking to see if we contain the key, " + key);
-        System.out.println("we actual contain -- " + toolMap);
-        return toolMap.containsKey(key);
-    }
-
-    public Object internalGet(String key) {
-        return toolMap.get(key);
-    }
-
-    public Object internalPut(String s, Object o) {
-        // do nothing
-        return null;
-    }
-}