Resolution: Won't Fix
Affects Version/s: 2.1.19
Fix Version/s: None
Glassfish 3.1.2, Mojarra 2.1.9
Test Case is attached.
The bean itself is session-scoped. The page has a component created programmatically. The component has style sheet component attached.
Go to http://HOST:8080/jsfres/index.xhtml to load the form. Pay attention to the div border. Click Submit. The form is returned since there is validation error. The div border is different from the first-time since the style sheet created programmatically is not lost.
If I change bean to RequestScoped, the stylesheet is loaded correctly each time.
If I change javax.faces.PARTIAL_STATE_SAVING to false, the issue can be repeated like this. 1) load index.xhtml. Click submit. 2) reload index.xhtml again(instead of resubmit).
If I change state-saving to client, I have the same problem.
I once observed this kind of issue in another situation(http://forum.primefaces.org/viewtopic.php?f=3&t=27762). In that situation, the stylesheet and script are attached through ResourceDependencies annotation. However, I can not produce a simple test case for that. I am not sure whether they are the same issue or not.