這個(gè)原因是由于網(wǎng)站的jsp網(wǎng)頁(yè)沒(méi)有直接放在webroot下造成的。
目前的支持方式是:
打開(kāi)jsp源代碼,翻到最下面找到</body>標(biāo)簽,然后把下面的函數(shù)復(fù)制到</body>前面,函數(shù)調(diào)用傳遞的第二個(gè)參數(shù)是jsp相對(duì)于webroot的路徑相對(duì)關(guān)系。
<script>
function patchDataImage(parentId, prefix){
var parent = null;
if(parentId){
parent = $('#'+parentId);
}else{
parent = $(document);
}
if(parent && parent.length>0){
var imgs = parent.find('img');
imgs.filter(function(){
return 0===$(this).attr('src').indexOf('data/attachment');
}).each(function(){
$(this).attr('src', prefix+$(this).attr('src'));
});
}
}
patchDataImage(undefined, '../../');
</script>