如何解决防止h:graphicImage进入缓存的图像
我已经尝试了一些类似旧文章中所说的方法,但是没有任何帮助。 我想停止h:graphicImage从缓存目录中获取图像,以便可以更新图像
最后一次尝试是在xhtml文件的开头和结尾添加内容。但这没有帮助
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Upload images</title>
<h:outputStylesheet library="css" name="global.css" />
<meta http-equiv="Cache-Control" content="no-cache,no-store,must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>
</h:head>
<h:body>
<div class="header">
Upload Images
</div>
<h:form>
<h:commandButton value="submit" action="#{animal.submitImages()}" class="button" />
<br/>
</h:form>
<h:form enctype="multipart/form-data">
<h:panelGrid columns="5" class="upload_images_grid" columnClasses="label,input,error,image,remove" rowClasses="row">
<h:outputLabel value ="Profile Image: "/>
<h:inputFile id="ImageInput0" value="#{animal.image0}" validator="#{validators.validateImage}">
<f:ajax execute="ImageInput0" render="image0 error0" />
</h:inputFile>
<h:message for="ImageInput0" id="error0" class="error_mess"/>
<h:graphicImage id="image0" value="#{animal.imageName0}" class="image_upload" />
<h:commandLink value="remove" action="#{animal.remove(0)}">
</h:commandLink>
</h:panelGrid>
</h:form>
</h:body>
<h:head>
<meta http-equiv="Cache-Control" content="no-cache,must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>
</h:head>
</html>
解决方法
好吧,我现在意识到,如果我在每次启动应用程序之前每次都删除所有保留的文件,则它可以正常工作。但是,如果可能的话,我会继续寻找更好的解决方案
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。