Home » JSF h:graphicImage

JSF h:graphicImage

by Online Tutorials Library

JSF <h:graphicImage> Tag

JSF renders an HTML element “img” tag. This tag is used to render an image on the web page.

Example

Output:

It displays an image on web page.

JSF H graphicimage tag 1

In the above example, url attribute specifies the path to the image. The URL of the example tag begins with a slash (/), which adds the relative context path of the web application to the beginning of the path to the image.

Attributes

Attribute Description
id It is an identifier for this component. This id must be unique. You can use it to access HTML element in CSS and JS file.
name It is used to set resource-name for this resource.
url It is a context-relative URL to retrieve the resource associated with this component. This is an alias for the “value” property.
value It represents current value of this component.
height It is used to set hight of the image.
width It is used to set width of this image.
alt It is used to set alternate name of the image.
class It represents CSS class for this component.
dir It is a direction indication for text that does not inherit directionality. Valid values are “LTR” (left-to-right) and “RTL” (right-to-left).
library It is used to set library-name for this resource.
onclick It is method which invokes JavaScript code after onclick on the image.
rendered It is used to render this component. You can set it’s value true or false. Default value is true.
ismap It is a flag indicating that this image is to be used as a server side image map. Such an image must be enclosed within a hyperlink (“a”). A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as ismap=”ismap”.
usemap The name of a client side image map (an HTML “map” element) for which this element provides the image.
style It is used to set CSS style code to provide better user interface of this component.
Next TopicJSF <h:message>

You may also like