📄 servermethodcenter.java
字号:
package net.s3o.core.method;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.s3o.common.S3OConstant;
public class ServerMethodCenter {
private HashMap serverMethods=new HashMap();
public boolean invokeServerMethod(HttpServletRequest request, HttpServletResponse response){
boolean isBreak=false;
String[] methodNames=getServerMethodNames(request);
if (methodNames==null||serverMethods==null){
return false;
}
IBaseServerMethod serverMethod=null;
for (int i=0;i<methodNames.length;i++){
serverMethod=(IBaseServerMethod)serverMethods.get(methodNames[i]);
if (serverMethod!=null){
try {
boolean sucessed=serverMethod.doMethod(request, response);
if (sucessed && serverMethod.isBreakOnSuessed() || !sucessed && serverMethod.isBreakOnFailed()){
isBreak=true;
break;
}
} catch (Exception e) {
continue;
}
}
}
return isBreak;
}
public String[] getServerMethodNames(HttpServletRequest request){
String[] rs=request.getParameterValues(S3OConstant.FIELD_SERVER_METHOD);
return rs!=null && rs.length<1?null:rs;
}
public HashMap getServerMethods() {
return serverMethods;
}
public void setServerMethods(HashMap serverMethods) {
this.serverMethods = serverMethods;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -