Display image based on number value JSF
I have a number of details about a product which I wish to display. In my db the status of these items is stored as a number eg 1 - Worldwide, 2 - Europe Only, 3 - US Only
I currently use:
<h:outputText value="#{product.value}" />开发者_JAVA百科
Instead of the number I would like to display an image instead. What would be the best way to go about this?
Have images with filenames like status1.gif
, status2.gif
, status3.gif
and display it as <h:graphicImage>
with a "dynamic" filename as follows:
<h:graphicImage value="status#{product.value}.gif" />
精彩评论