从DB加载多个图像到jsp

发布于 2024-10-08 06:49:30 字数 338 浏览 0 评论 0原文

我正在从数据库 (blob) 检索多个图像并使用 将其加载到 jsp。

的所有“src”都会转到 servlet 并获取 blob 图像,并使用 response.getOutputStream().write() 输出。由于有大约 8 到 10 个图像,因此 websphere 服务器崩溃。

有什么想法吗?

我们可以将这些图像(从数据库获取后)存储在某个临时文件夹中,并在服务器中配置临时路径并使用 加载这些图像吗?

I am retrieving multiple images from database (blob) and loading it to jsp using <img src="www.xyz.com?img=123">.

All 'src' of <img> go to servlet and get the blob image and is outputted using response.getOutputStream().write(). Since there are some 8 to 10 images, the websphere server crashes.

Any idea?

Can we store these images (after getting from DB) in some temporary folder and the configure the temporary path in server and load these images using <img>?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↘人皮目录ツ 2024-10-15 06:49:30

如果您的应用程序服务器崩溃了,那看起来很奇怪。检查是否关闭数据库连接以及像response.getOutputStream()这样的流。如果将图像存储在文件夹中,例如在 Apache 等 Web 服务器中配置 img 文件夹,并将图像写入 /img/image_id ,则速度会快 10 倍以上

That's look very strange if your application server crashes. Check if you close database connection, and streams like response.getOutputStream() . It's more than 10 times faster if you store images in folder, let say, configure img folder in web server like Apache, and write image to /img/image_id

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文