简体   繁体   English

重新部署之前,Web应用程序中的图像不会显示吗?

[英]Images in a web application won't show up until it's redeployed?

I'm working on a project for my web development class, it's a basic image upload / search system. 我正在为我的Web开发课程开发一个项目,它是一个基本的图像上传/搜索系统。 Users can upload the images successfully, the only problem is they won't show up in a search until I redeploy the web app! 用户可以成功上传图像,唯一的问题是,直到我重新部署Web应用程序之后,它们才会出现在搜索中! The link is there with the correct image paths, everything is correct in the database, but it will 404 if I click on it unless I redeploy the web application. 链接中包含正确的图像路径,数据库中的所有内容都是正确的,但是如果单击它,它将返回404,除非重新部署Web应用程序。

I'm not sure what kind of code I could show you guys for this, and it's hard to find a google result for the issue. 我不确定我可以向您显示哪种代码,因此很难找到该问题的Google结果。

the server I'm using is weblogic built into jdeveloper (most recent version, 11g I think?) 我正在使用的服务器是内置于jdeveloper中的weblogic(我认为最新版本为11g?)

My guess is it doesn't scan the directories that have the images until it starts the app, therefore anything added after the initial deploy won't show up. 我的猜测是,在启动应用程序之前,它不会扫描包含映像的目录,因此在初始部署之后添加的任何内容都不会显示。 Is there any way to force it to scan the directory after a successful upload? 成功上载后,有什么方法可以强迫它扫描目录吗?

Do you have to use that web server? 您必须使用该Web服务器吗? Try tomcat and see if you get the same issue. 尝试tomcat,看看是否遇到相同的问题。 I take it btw that by redeploy your mean you have to stop and restart the server? 顺带一提,通过重新部署您的意思,您必须停止并重新启动服务器吗? Does that process copy your webapp to another part of your disk so the web server is looking in a "mirror" dir instead of at the original webapp dir? 该过程是否会将您的Web应用程序复制到磁盘的另一部分,以便Web服务器在“镜像”目录中查找而不是在原始Webapp目录中查找? That could be the issue 那可能是问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM