Skip to content

Bug Report: java.lang.String cannot be converted to java.lang.Long in JSF EL Expression #21

@kamilkrzywanski

Description

@kamilkrzywanski

When using a <c:if> tag with a JSF Expression Language (EL) expression that performs a numeric operation, such as:

<c:if test="#{testView.string == 56 * 1}">
</c:if>

The following error is thrown:
Cannot convert [Welcome to PrimeFaces!!!] of type [class java.lang.String] to [class java.lang.Long]
Here, testView.string is a String property (Welcome to PrimeFaces!!!), and the comparison with a numeric expression 56 * 1 leads to a type mismatch.

Probably regression commit:
704050f#diff-2ff982307127640577acb628d13e962081390439c5f3a62d694d09a42a1dfdd2L116

Example project with this bug:
primefaces-test-cast-to-long.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions