JSF h:outputStylesheet doesn't work everywhere

Posted by s3rius on Stack Overflow See other posts from Stack Overflow or by s3rius
Published on 2012-07-05T15:02:56Z Indexed on 2012/07/05 15:15 UTC
Read the original article Hit count: 202

Filed under:
|
|
|
|

I'm currently learning Icefaces, now I'm trying to integrate a css file via h:OutputStylesheet into my code.

I have a main page and a second page. Using outputStylesheet in my main page works well (and then I can also access the css in the second page, which I guess is intended). But when I try to integrate it in my second page it doesn't work at all.

The code for both pages is basically identical.

main page:

<h:head></h:head> 
<h:body>
    <!-- this line works -->
    <h:outputStylesheet library="css" name="style.css"  />

    <!-- this line is only shown in red if the outputStylesheet
         from above is there -->
    <div class="red">This is red color in main page</div>

</h:body>

second page:

<h:head></h:head>

<h:body>
    <!-- this line doesn't work -->
    <h:outputStylesheet library="css" name="style.css"  />

    <!-- this line is only shown in red if the outputStylesheet
         in main page is there -->
    <div class="red">This is red color in second page</div>

</h:body>

I've made sure that I have h:body and h:head tags in both files. There's nothing more in the html pages except the standard doctype and xml version declarations. I've tried packing everything into h:forms, but that doesn't change anything.

Can anyone explain to me what's going on?

© Stack Overflow or respective owner

Related posts about java

Related posts about html