Problems dynamically loading stylesheet via JSF 2.0 <h:outputStylesheet>
I’m having some woes regarding the tag. My website has a bit of a unique setup. It really is four sites in one. The backing bean to each of the four sub-sites home page 开发者_如何学Godetermines a couple session variables, one of those being the style sheet. I am using a simple EL expression to determine the specific domain set in the session variable. I am upgrading my project from MyFaces 1.1 to Mojarra 2.0. I am trying to remove most if not all of the MyFaces and Tomahawk dependencies. I was previously using Tomahawk’s tag with no issues; however, I'm having weird behavior using the new 2.0 component.
The problem is it takes two clicks to get the style sheet to reload. The scenario being, if I am on sub-site A, and I click my browsers bookmark to take me to sub-site B, the style sheet does not refresh. I have to click the bookmark a second time in order for everything to render correctly. I did not have any issues using the Tomahawk tag, but I would like to phase out as many of my Tomahawk references. From all I can see from the documentation, the “target” attribute has no relevance to the tag, nor does changing/including this attribute have any effect. I've also tried placing the tag in the and tags just to see if I could get any behavior changes. The always renders in the head, which it should...
I asked this question on javaRanch, but no luck yet:
http://www.coderanch.com/t/523097/JSF/java/JSF-outputStylesheetAnyone have any ideas?
Configuration:
Tomcat 6.0.14 JSF Mojarra 2.0.3Thank you in advance for any help!!!
So, I found the problem with this a while back, but I forgot to come back and answer this question. Hopefully it will add some value to someone else.
The problem is a bug within JSF 2.0.3. I just happened to try out a newer JSF version, and with that, the issue goes away.
Thanks everyone for taking the time to look into this!
精彩评论