-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FACELETS_REFRESH_PERIOD > 0 triggers incorrect rendering #5059
Comments
Looks reasonable at a glance. Since we're just working in the 4.0 TCK now, test-jsf.zip could be made into a TCK test as well. @BalusC what do you think? |
If you want I can change the little app into a jakarta one and trying to create a test-app (or add the xhtml files to a existing one). But I cannot even compile the master branch right now cos the artifacts are not in maven ( |
can't reproduce on Faces 3.0.2 with the following conf: 🤔
|
Hi @pizzi80 ! I can reproduce the error in glassfish 6.2.3 (mojarra 3.0.1) and copying 3.0.2 into With my little change the style is not missed. Also tested. |
very curious! with the following java and xhtml snippets I've tested also with ajax
|
My test also fails in tomcat 10 and jdk 17. Note that the failure also depends in how the xhtml files are included and templated (when the timestamp is added). If you are testing with another app it can work OK. But my test fails in every jsf 3.0.2 no matter the jdk or the container. Please test with my reproducer. |
You're right! reproduced also with ajax, the attributes are missing inside the response |
@rmartinc Sending a PR with it all would be a good way to go! |
I'll send a PR the next week. I could compile master branch adding repos from https://jakarta.oss.sonatype.org. But I see that now in master all the |
@arjantijms @mnriem I submitted PR #5062. Thanks! |
That's correct, the tests have been moved to https://github.com/jakartaee/faces/tree/master/tck They were always intended and setup to be implementation neutral, so we used them as base for the new TCK. |
Should also be fixed in 2.3 and 3.0. |
Issue eclipse-ee4j#5059: FACELETS_REFRESH_PERIOD > 0 triggers incorrect rendering
…riggers incorrect rendering Signed-off-by: melloware <[email protected]>
I have added backports for 2.3 and 3.0 PRs |
Fix #5059: Backport for 3.0 FACELETS_REFRESH_PERIOD > 0
Fix #5059: Backport for 2.3 FACELETS_REFRESH_PERIOD > 0
Describe the bug
If the option
javax.faces.FACELETS_REFRESH_PERIOD
is configured in theweb.xml
to something greater than 0 it makes that some attributes are not rendered OK for the components. In the attached application the HtmlForm loses thestyle
attribute.To Reproduce
Compile and deploy the attached app:
unzip test-jsf.zip cd test-jsf mvn clean install
Go to the test page, http://127.0.0.1:8080/test-jsf/test.xhtml and click the button two times. The style for the text is different. Check the form in the html page and it has no style attribute.
Expected behavior
The form should maintain the style attribute.
Desktop (please complete the following information):
Additional context
Looking the code the problem is that the
DefaultFacelet.java
adds a timestamp when using the refresh time to remove old elements (here). It happens that the form uses an optimized rendering that renders the attrs in attributesThatAreSet. Those seem to be removed when adding the timestamp.@arjantijms @BalusC Don't we need to initiate the list of the delta like this?
With that change I'm initializing the delta with the contents of the default, and then adding the new value. If not the delta only contains the added attribute but loses the previous ones. And the restore only resets the timestamp losing the original style.
I can send a PR if you want or you can add the change. I tested with version 2.3 and I see no regression.
Thanks in advance!
test-jsf.zip
The text was updated successfully, but these errors were encountered: