title: How can I get my input type hidden value in my faces message bean (when h:commandLink clicked)?
body: <p>Fairly new to JSF here, so any help much appreciated. I am using JSF 1.2 with WebSphere Portal.</p>
  
  <p>I have an  field in my JSP and I am trying to get the value in my FMB. Problem is, when I write the value to the log from my FMB, it is coming out as NULL. Not sure why. </p>
  
  <p>The JSF action is called from a commandLink:</p>
  
  <pre><code>&lt;h:commandLink action="#{planDocBean.classAction}"&gt;
  </code></pre>
  
  <p>The FMB code is as follows:</p>
  
  <pre><code>String state = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("stateValue");
  log.debug("stateValue FMB: " + state);
  </code></pre>
  
  <p>My JSP:</p>
  
  <pre><code>&lt;input type="hidden" id="stateValue" value="${stateValue}" /&gt;
  </code></pre>
  
  <p>The javascript piece is called from an onChange function for a State value drop down to update the hidden input value. This piece works.</p>
  
  <p>Javascript in JSP:</p>
  
  <pre><code>function setStateValue() {
  var stateValue = document.getElementById("stateValue").value;
  var e = document.getElementById("states");
  var selectedState = e.options[e.selectedIndex].value;
  document.getElementById("stateValue").value = selectedState;
  }
  </code></pre>
  
  <p>I know there is the alternative h:inputHidden way of doing it, but I would like to know why this isn't working.</p>
  
  <p>I have also tried this in my FMB, but still NULL:</p>
  
  <pre><code>HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
  log.debug("stateValue 1: " + req.getParameter("stateValue"));
  </code></pre>
  
  <p>Again, I would be very grateful for any assistance.</p>
  
  <p>Thanks!</p>