|
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
|
|
|
<%@ page import="com.api.mobilemode.web.mobile.BaseMobileAction"%>
|
|
|
|
<%@ page import="java.lang.reflect.Constructor"%>
|
|
|
|
<%@ page import="weaver.general.Util"%>
|
|
|
|
<%@ page import="net.sf.json.JSONObject"%>
|
|
|
|
<%@ page import="com.weaver.formmodel.mobile.utils.MobileCommonUtil"%>
|
|
|
|
<%@ page import="com.weaver.formmodel.exception.MobileModeException"%>
|
|
|
|
<%@ page import="weaver.general.Base64" %>
|
|
|
|
<%@ page import="weaver.general.BaseBean" %>
|
|
|
|
<%@ page import="com.engine.common.util.ParamUtil" %>
|
|
|
|
<%@ page import="java.util.Map" %>
|
|
|
|
<%
|
|
|
|
response.addHeader("Access-Control-Allow-Origin", "*");
|
|
|
|
String invoker = Util.null2String(request.getParameter("invoker")).trim();
|
|
|
|
if(invoker.equals("")){
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(!invoker.contains("com.api.mobilemode")){
|
|
|
|
invoker = new String(Base64.decode(invoker.getBytes()));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
// if ("19135".equals(Util.null2String(request.getParameter("fieldid")).trim())){
|
|
|
|
// new BaseBean().writeLog("fieldid====19135");
|
|
|
|
// request.setAttribute("fromModule","model");
|
|
|
|
// request.setAttribute("isFromMode","1");
|
|
|
|
// request.setAttribute("modeId","147");
|
|
|
|
// request.setAttribute("isbill","1");
|
|
|
|
// }
|
|
|
|
// Map<String, Object> stringObjectMap = ParamUtil.request2Map(request);
|
|
|
|
// new BaseBean().writeLog("stringObjectMap:"+stringObjectMap);
|
|
|
|
Class clazz = Class.forName(invoker);
|
|
|
|
if(BaseMobileAction.class.isAssignableFrom(clazz)){
|
|
|
|
Constructor ctor = clazz.getConstructor(new Class[] {HttpServletRequest.class, HttpServletResponse.class});
|
|
|
|
BaseMobileAction actionObj = (BaseMobileAction)ctor.newInstance(new Object[] {request, response});
|
|
|
|
actionObj.execute_proxy();
|
|
|
|
}else{//规避使用此jsp去反射调用其他的系统类
|
|
|
|
throw new MobileModeException("Illegal Access");
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
MobileCommonUtil.log(this.getClass(), ex);
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
if (ex.getCause() != null && ex.getCause() instanceof MobileModeException) {
|
|
|
|
result.put("code", ((MobileModeException) ex.getCause()).getCode());
|
|
|
|
}
|
|
|
|
result.put("status", "0");
|
|
|
|
result.put("errMsg", MobileCommonUtil.getExceptionMsgForClientDisplay(ex));
|
|
|
|
result.put("errMsg", ex.getMessage());
|
|
|
|
out.print(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
%>
|