You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.7 KiB
Plaintext
45 lines
1.7 KiB
Plaintext
<%@ 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" %>
|
|
<%
|
|
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())){
|
|
// request.setAttribute("");
|
|
// }
|
|
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);
|
|
}
|
|
|
|
%> |