Tapestry 4 动态图像资源
我将图像存储在数据库中,需要在挂毯页面中提供服务。
我打算编写一个 servlet(足够简单)来像我一直以来那样提供图像服务,但我认为使用资产或服务更面向挂毯。
在挂毯页面中包含动态图像的最简单/最整洁的方法是什么?
请记住,我正在根据页面设置的唯一标识符从数据库中提取字节数组,并且我需要在响应标头上设置内容类型。
感谢建议,p。
I have images stored in a database I need to serve within a tapestry page.
I was about to write a servlet (simple enough) to serve the image like I always have but I figured using an asset or a service was more tapestry oriented.
What would be the simplest/tidiest way to include a dynamic image within a tapestry page?
Bare in mind I am pulling a byte array out of the database based on a unique identifier set by the page and that I need to set the content type on the response header.
Advice appreciated, p.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要提供动态内容,您可以实现 < code>IEngineService,将其配置为服务,然后将下载链接指向该服务。
Tapestry wiki 上的此页面应该可以帮助您入门。
To serve dynamic content, you can implement an
IEngineService
, configure it as a service, and then point your download links towards that service.This page on the Tapestry wiki should help you get started.