前台静态页面与后台动态页面涉及的交互一般会跨域,jsonp是解决跨域的一种常见办法。如果后台动态页面还没有完成,前台这边可以制作一个jsp页面充当挡板,返回json串。前端可以根据json串来测试前台页面。
<%@ page language="java"%>
<%@ page language="java" import="java.util.*"
contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String callback = request.getParameter("callback");
out.println(callback +"({'status':'success','errorCode':null,'errorMessage':null,'data':{'totalPage':1,'totalRecordNum':8,'data':[{'businesstypename':'企业增资','code':'G62018BJ1000027','businesstypecode':'GZ','name':'中国华电集团增资项目20180408001','disclosureprice':'募集资金说明','id':'6432186b-0f37-4580-834f-f48366f90d21','accessNum':'0','disclosuretime':'2018-04-08'},{'businesstypename':'企业增资','code':'G62017BJ1000200','businesstypecode':'GZ','name':'烟台市金光矿山建设开发有限公司融资项目-1119有报名延牌','disclosureprice':'拟募集资金总额择优确定','id':'0b880857-0b36-4cee-ad3e-4883c90d5dfe','accessNum':'0','disclosuretime':'2017-11-19'},{'businesstypename':'企业增资','code':'G62018BJ1000032','businesstypecode':'GZ','name':'0521北京可信华泰信息技术有限公司增资扩股项目-会员录','disclosureprice':'1,200-8,970','id':'b91da1b2-4875-48eb-94be-0fcb3ad88202','accessNum':'0','disclosuretime':'2018-05-21'},{'businesstypename':'企业增资','code':'G62018BJ1000014','businesstypecode':'GZ','name':'国科量子通信网络有限公司增资项目--监测0109','disclosureprice':'择优确定','id':'c2acce57-79cc-4ada-ad52-d6eac57cff14','accessNum':'0','disclosuretime':'2018-01-09'},{'businesstypename':'企业增资','code':'G62018BJ1000031','businesstypecode':'GZ','name':'北京可信华泰信息技术有限公司增资扩股项目--0521','disclosureprice':'9,060','id':'4e1424a4-f5d4-4826-896f-78e02a6c8e3e','accessNum':'0','disclosuretime':'2018-05-21'},{'businesstypename':'企业增资','code':'G62017BJ1000212','businesstypecode':'GZ','name':'近三年年度审计报告及最近一期财务数据为准确的','disclosureprice':'拟募集资金总额择优确定','id':'b1ffe8b1-009b-48f5-9a5b-31c215a43c7d','accessNum':'0','disclosuretime':'2017-11-29'},{'businesstypename':'企业增资','code':'G62018BJ1000029','businesstypecode':'GZ','name':'北京可信华泰信息技术有限公司增资扩股项目---0421','disclosureprice':'9,060','id':'ecc7b8ff-4c80-456b-8ed2-1beb328386a9','accessNum':'0','disclosuretime':'2018-04-21'},{'businesstypename':'企业增资','code':'G62018BJ1000030','businesstypecode':'GZ','name':'北京可信华泰信息技术有限公司增资扩股项目0502','disclosureprice':'9,060.00','id':'3999daea-9f32-48bc-a1b5-5e4dc140ff01','accessNum':'0','disclosuretime':'2018-05-03'}]}})");
%>