在controller中:
@Controller
@RequestMapping("/index.html")
public class MyIndexController {
@RequestMapping(method=RequestMethod.GET)
protected String gotoIndex(Model model) throws Exception {
return "myLandingPage"
}
}
在web.xml中配置如下:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
html页面通过 ajax请求的response返回 return mapper.toJson()//json字符串然后html通过ajax返回值获取进行处理类似
Java code?
$.ajax({
url : "${pageContext.request.contextPath}/admin/wxflowMainNodeLog/view.do",
async : true,
data:data,
dataType : 'json',
type : 'GET',
success : function(rtn, textStatus) {
//业务控制
if(rtn.result == "success"){
$("#docId").val(rtn.data.docId)
$("#docSubject").val(rtn.data.docSubject)
$("#mainId").val(rtn.data.mainId)
$("#nodeId").val(rtn.data.nodeId)
$("#auditId").val(rtn.data.auditId)
$("#mediaId").val(rtn.data.mediaId)
$("#mediaUrl").val(rtn.data.mediaUrl)
$("#curActor").val(rtn.data.curActor)
$("#myModal").modal("show")
}else{
alert(rtn.message)
}
},
error : function(jqXHR, textStatus,
errorThrown) {
var sessionstatus = jqXHRgetResponseHeader("sessionstatus")
if (sessionstatus == "timeout") {
alert(i1510.sessionOutMes)
var req_address = i1510.sessionOutUrl
window.location.href = req_address
}
}
})
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)