2

I have an issue (no big deal but wanted to see if anybody else had seen it) where I have an structure like the one below:

<ui:repeat var="categoria"
value="#{newsletterPage.categoriasNewsletter}" varStatus="it">
    boring code...
    <ui:repeat
        value="#{newsletterPage.getOportunidadesPremium(categoria)}"
        var="trio">
        boring code...
    </ui:repeat>

categoria is an Enum from the enum list categoriasNewsletter and by each category I need to get some data from getOportunidadesPremium(categoria).

The error happens exactly on getOportunidadesPremium because somehow when categoria is passed as a parameter it's null inside the method. The funny story is this is null ONLY when using development stage, if it is production stage everything is fine, just by changing the:

    <context-param>
          <param-name>javax.faces.PROJECT_STAGE</param-name>
         <param-value>Production</param-value>
    </context-param>

I'm using primefaces 3.4 and

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1.10</version>
    </dependency>

    <dependency>
        <groupId>org.glassfish.web</groupId>
        <artifactId>el-impl</artifactId>
        <version>2.2</version>
    </dependency>

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.1.10</version>
    </dependency>

I'm not asking for a fix for it as I suppose must be an api issue (and in production it'll be Production), just wanted to know if you have seen anything like this.

Thanks.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I don't recall ever having seen this one. In Mojarra 2.1.12 and 2.1.15 there were several fixes related to state management in nested ui:repeats. Please give it a try to see if it has covered your problem as well. – BalusC Dec 11 '12 at 12:44
  • Hi BalusC thanks for the tip. Tried with both and none worked. Do you think this is worthy bringing to the community team ? – user1894726 Dec 11 '12 at 13:24
  • Let me try to reproduce it first. So far, I can't reproduce it with a quick kickoff example on Tomcat 7.0.27. So I now suspect Glassfish's EL implementation, but it actually surprises me if it would have been dependent on JSF project stage. Which servletcontainer are you using by the way? The strange non-provided EL 2.2 dependency suggests that you're either just using Glassfish, or are somehow trying to use Glassfish EL in a different container. – BalusC Dec 11 '12 at 13:37
  • I'm using Tomcat 6.0.36. I needed this dependency to work on 2.4 servlet containers (if I can remember). – user1894726 Dec 11 '12 at 14:45
  • Whoa, so you're using an EL 2.2 impl on an EL 2.1 API? This is not entirely right. Tomcat 6 is Servlet 2.5 by the way. What if you use [JBoss EL 2.0](https://maven.atlassian.com/content/repositories/jboss-releases/org/jboss/seam/jboss-el/2.0.0.GA/) instead? This is an EL 2.1 impl supporting EL 2.2-like features. See also http://stackoverflow.com/questions/8325298/invoking-methods-with-parameters-by-el-in-jsf-1-2/8326551#8326551 for required Mojarra-specific web.xml configuration entry. – BalusC Dec 11 '12 at 14:50

0 Answers0