title: Null Pointer exception while getting request parameters
body: <pre><code>&lt;h:dataTable id="dt1" value="#{StudentMark.stuList}" var="stuList"  bgcolor="#9AC8E6" border="10" cellpadding="5" cellspacing="3" rows="18" width="120%" dir="LTR" frame="hsides&gt;
                  &lt;h:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText style=""value="Student Number" /&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputText style="" value="#{stuList.stuNumber}"&gt;&lt;/h:outputText&gt;
                  &lt;/h:column&gt;
                  &lt;h:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Date"/&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputText value="#{stuList.date}"&gt;
                          &lt;f:convertDateTime type="date" pattern="dd-MM-yyyy"/&gt;&lt;/h:outputText&gt;
                  &lt;/h:column&gt;
                  &lt;h:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Name"/&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputText value="#{stuList.stuName}"&gt;&lt;/h:outputText&gt;
                  &lt;/h:column&gt;
                  &lt;h:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Division"/&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputText value="#{stuList.division}"&gt;&lt;/h:outputText&gt;
                  &lt;/h:column&gt;
                  &lt;h:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Annual Marks"/&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputText value="#{stuList.annualMark}"&gt;&lt;/h:outputText&gt;
                  &lt;/h:column&gt;                    
                  &lt;h:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Student History"/&gt;
                      &lt;/f:facet&gt;
                       &lt;h:form&gt;
                          &lt;h:commandButton id = "historyBtn" value="Student History" action="#{stuBean.showHistory}"&gt;
                              &lt;f:param name="sNumber" value="#{stuBean.stuNumber}" /&gt;
                              &lt;f:param name="sName" value="#{stuBean.stuName}" /&gt;
                          &lt;/h:commandButton&gt;&lt;/h:form&gt;                        
                  &lt;/h:column&gt;
              &lt;/h:dataTable&gt;
  </code></pre>
  
  <p>When i try to get the parameters passed using </p>
  
  <pre><code>        FacesContext context = FacesContext.getCurrentInstance();
          Map requestMap = context.getExternalContext().getRequestParameterMap();
          String studentNum = (String) requestMap.get("sNumber");
          String studentName = (String) requestMap.get("sName");
  </code></pre>
  
  <p>its showing "null" in studentName and studentNum thereby resulting with a null pointer exception.
  Any ideas to resolve this???</p>