refactor StatViewServlet support for jndi: unfinished

This commit is contained in:
sand
2012-08-08 17:50:34 +08:00
parent 2695045dbc
commit 2b4086981e
2 changed files with 28 additions and 14 deletions
@@ -33,8 +33,9 @@ public class ReflectionUtils {
return null;
}
}
public static Object callPublicMethod(Object obj, String methodName) {
public static Object callObjectMethod(Object obj, String methodName) {
try {
Method m = obj.getClass().getMethod(methodName);
return m.invoke(obj);
@@ -45,11 +46,11 @@ public class ReflectionUtils {
public void getTest() {
System.out.println("dd");
// return "test";
// return "test";
}
public static void main(String args[]) {
// System.out.println(callStaticMethod(new ReflectionUtils(), "getTest"));
System.out.println(callObjectMethod(new ReflectionUtils(), "getTest"));
}
}