You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.1 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String srvname = request.getParameter("srvname");
if(srvname==null || srvname.length()<1) srvname = "service.portal.app";
String method = request.getParameter("method");
if(method==null ||method.length()<1) method = "initFunction";
System.out.println("srvname==="+srvname);
System.out.println("method==="+method);
%>
<base href="<%=basePath%>" target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="wdk/theme/bs/core/js/wdk.js"></script>
<title>服务接口测试</title>
<script type="text/javascript">
var _appsrv = '<%=srvname%>';
var _method = '<%=method%>';
alert(_method);
function loadService(){
$.cuajax({
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
method: "post",
timeout: WDK_Timeout,
data: {
_SRVNAME: _appsrv,
_SRVMETHOD: _method,
_DATA:$.json2str({
initFunction: 'imp_hz',
})
},
success:function(result) {
//返回值字符串转json
var jres = $.str2json(result);
alert(jres.desc);
$("#resultDiv").html(result);
},
error:function(result){
alert('网络错误!result=' + result);
}
});
}
//加载服务
loadService();
</script>
</head>
<body class="easyui-layout">
<div style="margin:100px;">
测试服务:<span id="severDiv" style="color:red;"></span>&nbsp;
返回结果集:<br/><br/>
<span id="resultDiv"></span>
</div>
</body>
</html>