zoukankan      html  css  js  c++  java
  • JSF 2 graphicImage example

    In JSF, you can use <h:graphicImage /> tag to render a HTML “img” element. For example, an image named “sofa.png” in a resources folder, see figure below :
    jsf2-graphicImage-example

    1. JSF 1.x graphicImage

    In JSF 1.x you can hard-coded above image URL directly in the “value” attribute :

    JSF…

    <h:graphicImage value="resources/images/sofa.png" />
    

    HTML output…

    <img src="resources/images/sofa.png;" alt="" />
    

    2. JSF 2.x graphicImage

    In JSF 2.0, you can render above image via “resource library” concept :

    JSF…

    <h:graphicImage library="images" name="sofa.png" />
    

    HTML output…

    <img src="/JavaServerFaces/faces/javax.faces.resource/sofa.png?ln=images" alt="" />
    
  • 相关阅读:
    工具类-vim在shell中卡死的情况
    tomcat日志分类
    逻辑运算
    牛客练习赛29 F 算式子
    牛客练习赛29 B
    查询
    hdu 5984
    zoj 4057
    zoj 4056
    zoj 4054
  • 原文地址:https://www.cnblogs.com/ghgyj/p/4765392.html
Copyright © 2011-2022 走看看