如何在adf 12c中显示存储在数据库中的源图像

问题描述 投票:0回答:1

我正在使用数据库12c在adf 12c中开发融合web应用程序。

这是.jsf页面上显示的图像代码。

<af:image id="i1" source="#{resource['UplDwn_Data:1.png']}"/>

现在我想显示存储在数据库中的源图像。我已成功上传图像并在数据库中保存源值,而不是将图像作为BLOB类型存储在数据库中。

我在数据库中存储完整的源值,例如"#{resource['UplDwn_Data:1.png']}"

这是输入文本字段的代码,我从数据库中获取数据。

<af:inputText value="#{bindings.Image.inputValue}" 
  label="Picture DB" rendered="true" simple="true" 
  required="#{bindings.Image.hints.mandatory}" 
  columns="#{bindings.Image.hints.displayWidth}" 
  maximumLength="#{bindings.Image.hints.precision}" 
  shortDesc="#{bindings.Image.hints.tooltip}" id="it66" 
  binding="#{FileManageBean.dbValue}">
 <f:validator binding="#{bindings.Image.validator}"/>
</af:inputText>

以下是在浏览器中运行后上面代码的屏幕截图:data stored in database

我想使用此数据作为图像源在.jsf页面上显示。

如果你有任何其他的想法将是非常可观的,但请记住我不想将图像存储为数据库中的blob类型。

oracle12c oracle-adf jdeveloper
1个回答
1
投票

只需将af:image的source属性设置为来自DB的值。请注意,DB中的值应该是图像的完整URL(或至少是相对URL)。

© www.soinside.com 2019 - 2024. All rights reserved.