我有一个jsp页面,我正在检查数据库中是否有任何记录。如果是,那么我正在显示它们,如果没有那么我正在调用其余的webservice然后我在生成的浏览器上得到服务的响应窗口。但我想在生成响应的页面上给出一些链接。那么我怎么能这样做,因为我没有生成响应的页面URL。这是我的代码。
RestConroller -
@RequestMapping(value = "/invoke/healthcheck", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseModel doHealthCheck(){
ResponseModel response = null;
HEALTHCHECK hcObj = null;
ArrayList stausList = null;
try {
response = new ResponseModel();
hcObj= new HEALTHCHECK();
stausList = hcObj.checkPrerequisits();
response.setData(stausList);
} catch (Exception e) {
logger.error("Exception in getting healthCheckStatus : "+e);
}
return response;
}
JSP -
<body>
<form action="healthcheck.jsp" method="GET" id="healthCheckform">
<h3 align="center">HealthCheck Details</h3>
<%
HEALTHCHECK obj = new HEALTHCHECK();
HEALTHCHECK healthCheck = new HEALTHCHECK();
ArrayList<HashMap> statusList = healthCheck
.selectHealthCheckDetails();
if (statusList.size() == 0) {
%>
<div>
<a href="dataAnalytics/invoke/healthcheck" target="_Self" id="a" >Click
Here </a> for initiating health check details
</div>
<%
} else {
......
}