Forums Register Login

Fonts for outputText changed after upgrade javax.faces.jar from 2.1.6 to new 2.1.29

+Pie Number of slices to send: Send
Hi,

My environment is: NetBeans 8.0.1 + Glassfish 3.1.2.2 + JSF 2.1 + Richfaces 4.3.7 + CDI/Weld 1.1.8 (original) + Apache CODI 1.0.6 + JPA 2 + Hibernate 4.2.7 + RDBMS Firebird 2.5.2 + JasperReports 5.5.

Yesterday, I started tests after changing the original javax.faces.jar 2.1.6 that comes with Glassfish to the new 2.1.29 downloaded.

Then, the h:outputText labels from my webapp becames bigger.
All other components become exactly the same size.

Below sample attachments from the "old 2.1.6 page" and "new 2.1.29 page" in Firefox 33 and Chrome 39. Same behaviour in IE too.
Using Chrome, the difference in outputText is more visible.
The only change in my project was javax.faces.jar file.

JSF-Firefox-OutputText.jpg
Firefox with old and new pages
[Thumbnail for JSF-Firefox-OutputText.jpg]
JSF-Chrome-OutputText.jpg
Chrome with old and new pages
[Thumbnail for JSF-Chrome-OutputText.jpg]
+Pie Number of slices to send: Send
Welcome to the JavaRanch, Edilmar!

h:outputText should not be setting any style info by default (unless something's been changed that I don't know about).

I recommend using your browser's page element inspection tool to see what styles have been applied and see if you can tell what set them.
+Pie Number of slices to send: Send
I dont know if this is a bug in JSF 2.1.6 that doesn't recognize the font configuration from the browser and uses the configuration defined in my css file:



or newer versions of JSF uses the configuration from the browser and ignores the configuration defined in my css file.
+Pie Number of slices to send: Send
Behaviour of formatting outputTexts:
- JSF 2.1.6: if I don't define a CSS style, it uses some internal default font size and not the font size from my "CSS body" general config
- JSF 2.1.29: if I don't define a CSS style, it uses the browser default font size and not the font size from my "CSS body" general config
Then, I was happy with internal font size from 2.1.6 that allowed the same layout at all browsers.
Now, with 2.1.29 I will have to configure a CSS style class at all outputTexts to ensure the same layout at all browsers.
+Pie Number of slices to send: Send
JSF doesn't "use" CSS at all. It just passes stuff along. The browser is responsible for dealing with CSS and there are very definite precedence rules.

Check the generated tags to make sure that there's a proper body HTML tag in the proper place.

The Firefox browser's Firebug extension will show what CSS has been applied from where and additionally illustrate what elements have been overridden.
+Pie Number of slices to send: Send
Again... I made two tests:
1) creating a xhtml without Richfaces
2) creating a xhtml with Richfaces but without any Richfaces component
3) creating a xhtml with Richfaces like page above that uses many components with their CSS layouts

I created the outputText without style class, to use the default style defined.

- 2.1.6: same behaviour in 1), 2), 3)
- 2.1.29:
===> 1) uses my "CSS body" font config
===> 2) uses my "CSS body" font config
===> 3) uses browser default font config => this case I have to force a CSS style for all outputTexts, I think there is some CSS layout from Richfaces components that changes the default config and causes confusion for all the layout
+Pie Number of slices to send: Send
RichFaces is "skinnable". There are something like 5 basic skins shipped with RichFaces, with the BlueSky skin being the default (you can override this in web.xml).

So yes, RichFaces is almost certainly setting the page default font, weight, style, and point size, probably on the h:body element (another reason to use h:body and not just HTML BODY).
Evil is afoot. But this tiny ad is just an ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1546 times.
Similar Threads
CDI or ManagedBean which is best to work with JSF?
@Named and @ManagedBean
CDI Question and jar
disabled issue for inputtext
Changing default value for JSF tag Property
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:26:55.