1.在ftl页面中,放入一个iframe标签
<iframe id="attachmentInfo" style="width:100%;" ></iframe>
2.js中增加一个方法,将新页面的链接放入iframe中
function preview(attachmentId) {
var myIframe = $("#attachmentInfo");
var url= basePath + "irest/base/commonFileUploadHandler/preview?id="+attachmentId+"&split=1";
$('#attachmentInfo').attr('src', url);
}
如果是直接打开一个新窗口展示url生成的页面,用一下代码即可
window.open(basePath + "irest/base/commonFileUploadHandler/preview?id="+attachmentId+"&split=1");