Map amMap = PublicPattern.amMap;
String url = request.getRequestURI().toString();
String queryString = request.getQueryString();
System.out.println("url - " + url);
System.out.println("queryString - " + queryString);
String m = "";
String a = "";
String c11 = "";
if (queryString != null ) {
if (queryString.indexOf("callMethod") == -1) {
m = "method";
} else {
m = "callMethod";
}
c11 = request.getParameter(m);
}else{
c11 = getCallMethodName(form);
}
if (url != null){
String[] urls = url.split("/");
a = urls[urls.length-1];
a = a.substring(0, a.length()-3);
}
System.out.println("ActionName - " + a + " MethodNmae - " + c11);
ArrayList metList = (ArrayList) amMap.get(a);
Method metd = null;
String fdname = null;
if(metList != null && c11 != null){
for(int i=0; i < metList.size() ; i++){
if(metList.get(i).equals(c11)){
System.out.println("find ActionName -- " + a);
System.out.println("find MethodNmae -- " + c11);
Class clazz = form.getClass();// 获取集合中的对象类型
Field[] fds = clazz.getDeclaredFields();// 获取他的字段数组
Method[] methods = clazz.getMethods();
for (int z=0;z< methods.length;z++) {
String methodName = methods[z].getName();
if (!methodName.startsWith("get")) {
continue;
}
try {
Object obj;
obj = methods[z].invoke(form,null);
if("'".equals(obj)){
System.out.println(methodName + "find ---- '");
methodName = "set" + methodName.substring(3);
//metd = clazz.getMethod("set" + change(fdname), null);
Class[] cl=new Class[]{String.class};
metd = clazz.getMethod(methodName, cl);
Object[] o = {"''"};
metd.invoke(form, o);
}