diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/UrlBuilder.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/UrlBuilder.java index 3af2acf0c..94020dc5e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/UrlBuilder.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/UrlBuilder.java @@ -44,7 +44,8 @@ public class UrlBuilder { VISUALIZATION("/visualization"), VISUALIZATION_SHORT("/vis"), VISUALIZATION_AJAX("/visualizationAjax"), - VISUALIZATION_DATA("/visualizationData"); + VISUALIZATION_DATA("/visualizationData"), + EDIT_REQUEST_DISPATCH("/editRequestDispatch"); private final String path; diff --git a/webapp/src/freemarker/ext/dump/BaseDumpDirective.java b/webapp/src/freemarker/ext/dump/BaseDumpDirective.java index ce94a6a3e..8ec8c4522 100644 --- a/webapp/src/freemarker/ext/dump/BaseDumpDirective.java +++ b/webapp/src/freemarker/ext/dump/BaseDumpDirective.java @@ -344,10 +344,12 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel { } private Map getObjectDump(TemplateHashModelEx model, Object object) throws TemplateModelException { - Map map = new HashMap(); map.put(Key.TYPE.toString(), object.getClass().getName()); + if( object instanceof java.lang.reflect.Method) + return map; + // Compile the collections of properties and methods available to the template SortedMap properties = new TreeMap(); SortedMap methods = new TreeMap(); @@ -376,11 +378,25 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel { // like name/getName - we'll keep only the first form. for ( Method method : classMethods ) { + if( "declaringClass".equals( method.getName() )) + continue; + // Eliminate methods declared on Object Class c = method.getDeclaringClass(); - if (c.equals(java.lang.Object.class)) { + + if (c.equals(java.lang.Object.class) || + c.equals(java.lang.reflect.Constructor.class) || + c.equals(java.lang.reflect.Field.class ) ) continue; - } + + + if( + c.getPackage().getName().startsWith("sun.") || + c.getPackage().getName().startsWith("java.lang") || + c.getPackage().getName().startsWith("java.security") ) + continue; + + log.error("decalring class of method " + method.getName() + " is " + c.getName()); // Eliminate deprecated methods if (method.isAnnotationPresent(Deprecated.class)) { @@ -399,8 +415,12 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel { // The method is available as a property if (keySet.contains(propertyName)) { - TemplateModel value = model.get(propertyName); - properties.put(propertyName, getDump(value)); + try{ + TemplateModel value = model.get(propertyName); + properties.put(propertyName, getDump(value)); + }catch(Throwable th){ + log.error("problem dumping " + propertyName + " on " + object.getClass().getName(), th); + } continue; } }