Angularjs Jhipster v2.20.0:在生产模式下无法加载静态图片

Angularjs Jhipster v2.20.0:在生产模式下无法加载静态图片,angularjs,jhipster,Angularjs,Jhipster,我在生产模式下部署了Jhipster v2.20.0应用程序。在angularjs代码中,我将: img.src = assets/.../mypicture.png. 本地此图片已正确加载,但在生产模式下出现错误: [ERROR] org.springframework.boot.context.web.ErrorPageFilter - Cannot forward to error page for request [/assets/images/elements/teethscham

我在生产模式下部署了Jhipster v2.20.0应用程序。在angularjs代码中,我将:

img.src = assets/.../mypicture.png. 
本地此图片已正确加载,但在生产模式下出现错误:

[ERROR] org.springframework.boot.context.web.ErrorPageFilter - Cannot forward to error page for request [/assets/images/elements/teethschame/47.png] 

as the response has already been committed. As a result, the response may have the wrong status code. 

If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false
你能帮我解决这个问题吗


感谢JHipster 2.x中的grunt/gulp构建过程缩小并向图像添加修订哈希代码,以便浏览器可以永久缓存图像

因此,如果您在assets/images/mypicture.png中有一个图像,它将在dist/assets/images/mypicture-a1b2cde.png中提供。然后在prod profile中,StaticResourcesProductionFilter将在任何资产请求前添加/dist,但它不知道修订代码


因此,在您的情况下,要么您的代码必须引用版本化的图像名称,要么您应该通过将图像移到资产文件夹之外来排除图像被修改。

谢谢您的回复,但问题是我必须在Resources目录中创建一个名为:static、public或resource的目录,把我的镜像目录放进去,在spring boot中为他们服务。spring网站指出了这一点:

使用资源只是一种可能性,我的也在发挥作用。