Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:36:11+00:00 2026-06-11T22:36:11+00:00

Have xhtml templ.xhtml layout. Include it to other .xhtml like: <ui:composition template=/template/templ.xhtml> Define conditionals

  • 0

Have xhtml templ.xhtml layout.

Include it to other .xhtml like:

<ui:composition template="/template/templ.xhtml">

Define conditionals in templ.xhtml like:

<h:head>
 <h:outputText value="&lt;!--[if lt IE 8]&gt;&lt;h:outputStylesheet library=&quot;css&quot; name=&quot;styleie8.css&quot; /&gt;&lt;![endif]--&gt;" escape="false" />
</h:head>

styleie8.css is not loaded,but when something changed and saved in templ.xhtml when Tomcat is running,that it loaded ok.

How to do,that JSF loads conditionals immediately when Tomcat started?

Note:
tried to use following alternatives:
1.

<!--[if lt IE 8]>
                <h:outputStylesheet name="styleie8.css" library="css"/>
<![endif]-->

2.

<o:conditionalComment if="lte IE 8">
            <link rel="stylesheet" href="styleie8.css" />
</o:conditionalComment>

3. #{request.contextPath}/resources instead of simple path.

The result is the same – I need resave .xhtml template in order to load conditionals css.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:36:12+00:00Added an answer on June 11, 2026 at 10:36 pm

    Your initial code snippet is wrong. You can’t print a <h:outputStylesheet> in a <h:outputText escape="false">. The <h:outputStylesheet> is a JSF component which is supposed to generate HTML, but in a <h:outputText escape="false"> it would be printed literally as-is. If you open the page in browser and do rightclick, View Source, then you should have discovered this yourself. This is not right. The webbrowser understands only HTML which should be <link rel="stylesheet">.

    Provided that you’ve placed the stylesheet in /resources/css/styleie8.css, then the following should work:

    <h:outputText value="&lt;!--[if lte IE 8]&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;#{request.contextPath}/resources/css/styleie8.css&quot; /&gt;&lt;![endif]--&gt;" escape="false" />
    

    As to the alternatives you tried, 1) would not work as it would be escaped. 2) should work assuming that the href points to the right URL. In the example as you’ve posted, it assumes the CSS file to be in the same folder as the view. However, if it is still located in /resources/css/styleie8.css, then you should have used:

    <o:conditionalComment if="lte IE 8">
        <link rel="stylesheet" href="#{request.contextPath}/resources/css/styleie8.css" />
    </o:conditionalComment>
    

    3) should work, assuming that you provided the right URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xhtml page where I do include some css files like: <link
I have a static html page weather.html <html xmlns=http://www.w3.org/1999/xhtml> <head> <title></title> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js></script>
I have a h:dataTable that displays ProfileNotification like below: <h:dataTable value=#{myBean.profileNotifications} var=item rendered=#{myBean.renderProfileNotification}> <h:column>
I have some XHTML (but really any XML will do) like this: <h1> Hello<span
I have a JSF 2.0 Webapplication into which I d'like to include TinyMCE 3.5.
I have an xhtml file, with a backing bean, i'd like to create a
I have transformed an XHTML file into other XHTML file with XSLT. It has
I have a sample.xhtml file which has few lines of javascript. This javascript will
I have a very simple xhtml file where a panelGroup containing a commandButton is
I have a well formed XHTML page. I want to find the destination URL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.