title: How can I get the query string
body: <p>I'm using jsf 1.1 and icefaces 1.8. I have a PartsInv.jsp page and a managed PartsInv.java bean. I've tried messing around with several classes based on google hits I've come across, and feel like I'm getting close, but I can't quite nail it. This is what I have:</p>
  
  <pre><code>HttpServletRequestWrapper hsrw;
  String rcVal = hsrw.getAttribute("rc").toString();
  </code></pre>
  
  <p>But of course <code>hsrw</code> isn't properly instantiated.. I'm not really sure how to (or what to wrap it around). Any help would be appreciated.</p>
  
  <p><strong>Edit</strong>: Based on Jigar's answer, I've updated my code to the following:</p>
  
  <pre><code>    HttpServletRequest hsr = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
  
      if(hsr.getAttribute("rc") != null)
      {
          try
          {
              int rc = Integer.parseInt(hsr.getAttribute("rc").toString());
              this.SOM_RC.setValue(rc);
              this.changeRC(null);
          }
          catch(NumberFormatException nfe)
          {
              this.lblStatus.setValue("eASP error, please see an administrator.");
              return;
          }
      }
  </code></pre>
  
  <p><strong>Edit2:</strong> ok, so i used the wrong method. <code>hsr.getParameter()</code> does the trick</p>