title: primefaces graphicImage f:param doesn't work
body: <p>I have JSF:</p>
  
  <pre><code>&lt;p:graphicImage value="#{chatView.userPhoto}"&gt;
      &lt;f:param name="userId" value="#{user.id}"/&gt;
  &lt;/p:graphicImage&gt;
  </code></pre>
  
  <p>user.id is valid I have checked.</p>
  
  <p>And bean:</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class ChatView extends BaseView {
  
      /*
       * Injecting managed beans in each other
       * http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#InjectingManagedBeansInEachOther
       */
      @ManagedProperty("#{chatUsers}")
      private ChatUsers users;
  
      public StreamedContent getUserPhoto() {         
          // there output is {}            
          System.out.println(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap()); 
  
          return new DefaultStreamedContent();
      }
  }
  </code></pre>
  
  <p>But I have empty map in debug output for requestParameterMap. Any idea why?</p>
  
  <p><strong>UPDATED:</strong></p>
  
  <p>I created a simple project with such pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;grim&lt;/groupId&gt;
      &lt;artifactId&gt;grim&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  
          &lt;version.jboss.bom&gt;9.0.0.CR1&lt;/version.jboss.bom&gt;
  
          &lt;version.primefaces&gt;5.2&lt;/version.primefaces&gt;
          &lt;version.atmosphere&gt;2.3.1&lt;/version.atmosphere&gt;
          &lt;version.jboss.logging&gt;3.2.1.Final&lt;/version.jboss.logging&gt;
      &lt;/properties&gt;
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.wildfly.bom&lt;/groupId&gt;
                  &lt;artifactId&gt;jboss-javaee-7.0-wildfly-with-tools&lt;/artifactId&gt;
                  &lt;version&gt;${version.jboss.bom}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;!-- First declare the APIs we depend on and need for compilation. All
                      of them are provided by JBoss WildFly --&gt;
  
          &lt;!-- Import the CDI API, we use provided scope as the API is included in
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.enterprise&lt;/groupId&gt;
              &lt;artifactId&gt;cdi-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the Common Annotations API (JSR-250), we use provided scope
              as the API is included in JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.annotation&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-annotations-api_1.2_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the JAX-RS API, we use provided scope as the API is included
              in JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;jaxrs-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!--Hibernate--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the JPA API, we use provided scope as the API is included in
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the EJB API, we use provided scope as the API is included in
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.ejb&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-ejb-api_3.2_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JSR-303 (Bean Validation) Implementation --&gt;
          &lt;!-- Provides portable constraints such as @Email --&gt;
          &lt;!-- Hibernate Validator is shipped in JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the JSF API, we use provided scope as the API is included in
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.faces&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-jsf-api_2.2_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Now we declare any tools needed --&gt;
  
          &lt;!-- Annotation processor to generate the JPA 2.0 metamodel classes for
              typesafe criteria queries --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpamodelgen&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Annotation processor that raising compilation errors whenever constraint
              annotations are incorrectly used. --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator-annotation-processor&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Needed for running tests (you may also use TestNG) --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Optional, but highly recommended --&gt;
          &lt;!-- Arquillian allows you to test enterprise code such as EJBs and Transactional(JTA)
              JPA from JUnit/TestNG --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.arquillian.junit&lt;/groupId&gt;
              &lt;artifactId&gt;arquillian-junit-container&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.arquillian.protocol&lt;/groupId&gt;
              &lt;artifactId&gt;arquillian-protocol-servlet&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the Servlet API, we use provided scope as the API is included in JBoss WildFly. --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-servlet-api_3.1_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!--PrimeFaces--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
              &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
              &lt;version&gt;${version.primefaces}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!--Atmosphere--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.atmosphere&lt;/groupId&gt;
              &lt;artifactId&gt;atmosphere-runtime&lt;/artifactId&gt;
              &lt;version&gt;${version.atmosphere}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
          &lt;!--Jboss Logging--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.logging&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-logging&lt;/artifactId&gt;
              &lt;version&gt;${version.jboss.logging}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class TestView {
  
      public StreamedContent getImg() {
      FacesContext context = FacesContext.getCurrentInstance();
      if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) {
          // So, we're rendering the HTML. Return a stub StreamedContent so that it will generate right URL.
          return new DefaultStreamedContent();
      }
      else {
          // So, browser is requesting the image. Return a real StreamedContent with the image bytes.
          String studentId = context.getExternalContext().getRequestParameterMap().get("shashistId");
          Shashist student = shashistService.find(Long.valueOf(studentId));
          return new DefaultStreamedContent(new ByteArrayInputStream(student.getPhoto()));
      }
      }
  }
  </code></pre>
  
  <p>And xhtml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core"&gt;
  &lt;f:view&gt;
      &lt;h:outputLabel value="Hello, world"/&gt;
      &lt;p:graphicImage value="#{testView.img}"&gt;
          &lt;f:param value="1" name="s"/&gt;
      &lt;/p:graphicImage&gt;
  &lt;/f:view&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But anyway I get empty request parameter map in debug output. </p>