Listing 2

The following JSF markup is used to create the gender form shown in example 2.

<x:fieldSet>
  <x:legend>
    <h:outputLabel value="Gender"/>
  </x:legend>
  <h:selectOneRadio id="gender" value="#{person.gender}">
    <f:selectItem itemLabel="Male" itemValue="m"/>
    <f:selectItem itemLabel="Female" itemValue="f"/>
    <f:selectItem itemLabel="Not Sure" itemValue="n"/>
  </h:selectOneRadio>
</x:fieldSet>

Note: this markup assumes x: is the prefix assigned to the Xavax custom tags in the JSP.