Multiple choice technology web technology

How do you declare a text label for an input control?

  1. Use the HtmlOutputLabel component

  2. Use the HtmlOutputLabel component with a child HtmlOutputText component

  3. Use the HtmlOutputText component

  4. Use the OutputLabel component

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

JSF requires wrapping label text inside a component when using standard output labels. The correct approach is using the HtmlOutputLabel component (h:outputLabel) and placing an HtmlOutputText (h:outputText) component inside it as a child to render the text. Simply using HtmlOutputText alone does not bind it as an HTML label element.