title: JSF & HTTP Requests
body: <p>let the following code fragment contains a link to <code>items.xhtml</code> that lists item names and enables the user to select an item in order to view its details:</p>
  
  <pre><code>&lt;?xml ... ?&gt;
  &lt;!DOCTYPE ... &gt;
  &lt;html ... &gt;
      &lt;h:head&gt;
          &lt;title&gt;Welcome&lt;/title&gt;
      &lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;h:outputLink value="#{facesContext.externalContext.requestContextPath}/faces/client/items.xhtml"&gt;Items&lt;/h:outputLink&gt;   
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When the user clicks the link named <code>Items</code>, then the request line states that the resource being requested is <code>/javaee7-training/faces/client/items.xhtml</code> and the desired action that should be applied to it is <code>GET</code>. That is fine.</p>
  
  <p>The following code shows a fragment of <code>items.xml</code>:</p>
  
  <pre><code>&lt;?xml ... ?&gt;
  &lt;!DOCTYPE ...&gt;
  &lt;html ...&gt;
      &lt;h:head&gt;
          &lt;title&gt;items&lt;/title&gt;
      &lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;h:form prependId="false"&gt;
              &lt;h:selectOneRadio value="#{bean.itemId}"
                                layout="pageDirection"&gt;
                  &lt;c:forEach items="#{bean.items}" var="itm"&gt;
                      &lt;f:selectItem itemValue="#{itm.itemno}" 
                                    itemLabel="#{itm.itemname}" /&gt;
                  &lt;/c:forEach&gt;
              &lt;/h:selectOneRadio&gt;
  
              &lt;h:commandButton value="Details" action="item" /&gt;
          &lt;/h:form&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now when the user clicks the button named <code>Details</code>, then the request line states that the resource being requested is <code>/javaee7-training/faces/client/items.xhtml</code> and the desired action that should be applied to it is <code>POST</code>. I don´t expected this result, because when the user clicks the button named <code>Details</code>, then the requested resource is <code>/javaee7-training/faces/client/item.xhtml</code> and the desired action is <code>GET</code>.</p>
  
  <p>Could anyone explain me this result and why I am wrong?</p>
  
  <p>Thank you in advance</p>