refactor StatViewServlet support for jndi: unfinished

This commit is contained in:
sand
2012-08-08 17:20:12 +08:00
parent c918a306fc
commit 2695045dbc
4 changed files with 47 additions and 42 deletions
@@ -33,13 +33,23 @@ public class ReflectionUtils {
return null;
}
}
public static Object callPublicMethod(Object obj, String methodName) {
try {
Method m = obj.getClass().getMethod(methodName);
return m.invoke(obj);
} catch (Exception e) {
return null;
}
}
public static String getTest() {
return "test";
public void getTest() {
System.out.println("dd");
// return "test";
}
public static void main(String args[]) {
System.out.println(callStaticMethod(ReflectionUtils.class, "getTest"));
// System.out.println(callStaticMethod(new ReflectionUtils(), "getTest"));
}
}