OmniFaces Showcase

To make JSF life easier

cdi

components

contexts

converters

eventlisteners

exceptionhandlers

facesviews

filters

functions

managedbeans

renderkits

resourcehandlers

scripts

taghandlers

utils

validators

viewhandlers

-

cache

commandScript

componentIdParam

conditionalComment

deferredScript

form

graphicImage

highlight

messages

moveComponent

onloadScript

outputFormat

outputLabel

param

resolveComponent

resourceInclude

tree

viewParam

The <o:conditionalComment> component renders a conditional comment. Conditional comments are an IE specific feature which enables the developer to (out)comment blocks of HTML depending on whether the client is using IE and if so even which version. They are often seen in combination with CSS stylesheets like so:

Note that you cannot use this with <h:outputStylesheet> as it would implicitly be relocated as direct child of <h:head>.

Demo

Only if you're using IE9 or older, you should see a pinkish background on this page.
Support for conditional comments has been discontinued in IE10.
It will only work if the IE10 browser is configured to run in a specific browser mode, e.g. IE9 mode.

<o:conditionalComment if="IE">
<link rel="stylesheet" href="#{resource['layout:css/ie.css']}" />
</o:conditionalComment>
<p>
Only if you're using IE9 or older, you should see a pinkish background on this page.
Support for conditional comments has been discontinued in IE10.
It will only work if the IE10 browser is configured to run in a specific browser mode, e.g. IE9 mode.
</p>