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

Evaluation of EL-Expression fails with custom PropertyResolver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6-SNAPSHOT, 1.1.6
    • 1.1.6
    • General
    • None

    Description

      When using a custom PropertyResolver in faces-config.xml like this:

      <application>
      <property-resolver>
      org.springframework.web.jsf.MessageSourcePropertyResolver
      </property-resolver>
      </application>

      the evaluation of an expression involving the PropertyResolver fails, when the expression appears on the right hand side. E.g. the expression #

      { bundle.test == 'xx' }

      succeeds, whereas #

      { 'xx' == bundle.test }

      fails. In this example the property resolver is responsible for evaluating the 'test' property on the object 'bundle'.

      MyFaces has an expression factory which reassembles the expressions generated from the commons-el parser. This is done by replacing the so called 'suffixes' see org.apache.myfaces.el.ELParserHelper. The bug occurs when instances of BinaryOperatorExpression are handled, because myfaces only replaces the suffix of the first operand. This is why the first example works and the second fails.

      Attachments

        1. ELParserHelper.java
          19 kB
          Stefan Rinke

        Activity

          People

            lu4242 Leonardo Uribe
            steve41 Stefan Rinke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: