mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor StatViewServlet support for jndi: unfinished
This commit is contained in:
@@ -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"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user