JSF 2.2 HTML Tags


When we create an XHTML page we could see the following list of URL’s on top of the page; Here, the namespace ‘h’ is referring HTML elements in the JSF. The HTML elements are used to render a web page in a browser. JSF offers its own tags for all the HTML elements; The purpose of JSF specific tags are many. Some of them are predefined style, layouts, Ajax controls, actions, templates etc. Current IDE’s like eclipse, JDeveloper etc supports drag and drop support. That is we can drag and drop these tags into the UI instead of writing it manually. The following table summarizes the list of JSF 2.2 HTML tags and its description. We cover all the UI components except the <h:dataTable> which requires a separate section.

Note: Prior version of JSF 2.2 uses the namespace xmlns:h=http://java.sun.com/jsf/html

102517_0339_JSFHTMLTags1 JSF 2.2 html tags




JSF tags and its corresponding HTML tags


JSF Tag Corresponding HTML5 Tag Description
h:commandLink <a > Use HTTP POST Request
h:commandButton <input> Use HTTP POST Request
h:button <input type=”button”> Use HTTP Get Request
h:link <a> Use HTTP Get Request
h:outputLink <a > Navigate to another website
h:head <head> Renders a HEAD tag
h:body <body> Renders a BODY tag
h:form <form> Renders a form tag
h:inputText <input type=’text’> A text field
h:inputFile <input type=’file’> A file upload field
h:inputHidden <input type=’hidden’> A field not visible to user
h:inputSecret <input type=’password’> A password field
h:inputTextArea <textarea> A multiline text field
h:outputText   Display a HTML text; Render a SPAN if style class specified
h:outputLabel <label> Label for Form element <Input>, <Select> etc
h:outputFormat   Similar to Outputtext but accept parameters
h:outputStylesheet <link type=”text/css”/> Include a CSS style sheet
h:outputScript <script type = “text/javascript”/> Include a Javascript
h:message   Used to display an error message
h:messages   Used to display error messages
h:graphicImage <img src=”” /> Renders an Image
h:panelGrid <table> Display a Table
h:panelGroup   Group a set of components under one parent
h:selectBooleanCheckbox <input type=’checkbox’> Renders a checkbox
h:selectManyCheckbox <table><tr><td><input type=’checkbox’>… Render a table of check boxes
h:selectOneListbox <Select size=5> Display a HTML Select with size specified
h:selectManyListbox <select multiple = “multiple” Display a multi select List Box
h:selectOneMenu <Select> Display a HTML Select without size specified
h:selectManyMenu <select multiple = “multiple” Display a multiselect menu box
h:selectOneRadio <input type=’radio’ Display a radio box
h:dataTable <table> Render and format HTML table

Source: Oracle

govindan JSF 2.2 html tags
Connect me


Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
govindan JSF 2.2 html tags
Connect me
By | 2017-11-23T16:31:12+00:00 October 24th, 2017|Categories: JSF|Tags: |0 Comments
Like us on Facebook.