Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1670

A dollar-type, 2 level EL expression evaluates to null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1-SNAPSHOT
    • Fix Version/s: 1.2.0-SNAPSHOT, 1.2.2
    • Component/s: JSR-252
    • Labels:
      None
    • Environment:
      geronimo-2.0-M6-rc1

      Description

      I have a simple code where dollar-type expression (like ${}) works differently than shrap-type expression (like #{}),
      I put into the http session a managed bean aggregating another bean.
      ${parent} is calculated, while ${parent.child} is always null (it is printed as an empty string and equals to null in "when" tag).

      For example the following snip of JSP code:
      <f:view>
      <h:form id="myform" >
      <b>Using sharp-el</b>: <br/>
      *<h:outputText id="cll1" value="#

      {customerDetailsBean}

      " />*<br/>
      *<h:outputText id="cll2" value="#

      {customerDetailsBean.customer}

      " />*<br/>
      <b>Using dollar-el</b>: <br/>
      ${customerDetailsBean}<br/>
      ${customerDetailsBean.customer}<br/>
      <b>Classical "servlet" style</b>: <br/>
      *<% if (session.getAttribute("customerDetailsBean") != null)

      {%><%= session.getAttribute("customerDetailsBean") %><% }

      %>*<br/>
      *<% if (session.getAttribute("customerDetailsBean") != null)

      {%><%= ((eltest.CustomerDetailsBean)session.getAttribute("customerDetailsBean")).getCustomer() %><% }

      %>*<br/>
      </h:form>
      </f:view>

      – PRODUCES --:

      Using sharp-el:
      CustomerDetailsBean: { customer: Customer {frstName: Alex , lastName: Zynevich, id: 1979}}
      *Customer

      {frstName: Alex , lastName: Zynevich, id: 1979}

      *
      Using dollar-el:
      CustomerDetailsBean: { customer: Customer {frstName: Alex , lastName: Zynevich, id: 1979}}
      **
      Classical "servlet" style:
      CustomerDetailsBean: { customer: Customer {frstName: Alex , lastName: Zynevich, id: 1979}}
      *Customer

      {frstName: Alex , lastName: Zynevich, id: 1979}

      *

      while I would expect:

      Using sharp-el:
      CustomerDetailsBean: { customer: Customer {frstName: Alex , lastName: Zynevich, id: 1979}}
      *Customer

      {frstName: Alex , lastName: Zynevich, id: 1979}

      *
      Using dollar-el:
      CustomerDetailsBean: { customer: Customer {frstName: Alex , lastName: Zynevich, id: 1979}}
      *Customer

      {frstName: Alex , lastName: Zynevich, id: 1979}

      *
      Classical "servlet" style:
      CustomerDetailsBean: { customer: Customer {frstName: Alex , lastName: Zynevich, id: 1979}}
      *Customer

      {frstName: Alex , lastName: Zynevich, id: 1979}

      *

      you may find the maven project at https://issues.apache.org/jira/browse/GERONIMO-3253, war is attached

        Attachments

        1. Customer.java
          0.6 kB
          Alexander Zynevich
        2. CustomerDetailsBean.java
          0.8 kB
          Alexander Zynevich
        3. eltest.war
          6 kB
          Alexander Zynevich
        4. faces-config.xml
          1 kB
          Alexander Zynevich
        5. MYFACES-1670.patch
          1 kB
          Bernhard Huemer
        6. print.jsp
          1 kB
          Alexander Zynevich
        7. web.xml
          1.0 kB
          Alexander Zynevich

          Issue Links

            Activity

              People

              • Assignee:
                mmarinschek Martin Marinschek
                Reporter:
                zynevich Alexander Zynevich
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: