Open hantsy opened 4 months ago
As a quick test, within GF (in a servlet, bean, whatever) you could try invoking Expression Language "manually" (using the universal Java SE way) to see if records work. Normally the RecordELResolver should be added just before the BeanELResolver.
Start with
ELProcessor elProcessor = new ELProcessor();
And then work with that on your types (just as a smoke test)
Tbh, I did not take a look whether extra setup is required in Mojarra. There probably is.
@arjantijms Tried it in a separate project, worked well.
Thank you very much, so the API and optionally perhaps Expressly works correct here.
I'll have to figure out where to add it in mojarra
@arjantijms Still failed in Glassfish 8.0.0-M7
@hantsy the following line in your example will crash any way:
<strong>#{customerBean.customer.firstName +' ' +customerBean.customer.lastName}</strong>
Removing that and with the latest 4.1.2-SNAPSHOT it does seem to work.
In <strong>#{customerBean.customer.firstName +' ' +customerBean.customer.lastName}</strong>
, plain +
should be replaced with +=
, which is an operator for string concatenation. Then it should work. Plain +
only works with numbers.
Sorry, I forgot to update this. But here it indicated some info similar to can not access property customer.firstName
, so I thought the EL resolver for record
was still not applied.
@hantsy If you want to try again, this binary https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/PR-25108/1/artifact/bundles/glassfish.zip includes the updated Mojarra 4.1.2.
@arjantijms I have tried this in the latest M8, and I found the Optional
evaluation in Faceslet is a little different from the ElProcessor
in expressly.
Environment Details
Problem Description
EL 6.0 supports record, but I have tried in a simple facelets page, failed to access the property.
The example project: https://github.com/hantsy/jakartaee11-sandbox/tree/master/faces
The back bean:
The facelets template: