0

I'm using the JSF 2.2. I can't add .css in my .xhtml page. Code in .xhtml

<h:head>
    <title>Login Page</title>
</h:head>

<h:body>
<h:outputStylesheet library="resources/css" name="style.css" id="cascade1"/>

Also I tried declare it into a <h:head> with the same result. FireBug is seeing this resource but it is showing message:

Reload the page to get source for .../javax.faces.resource/style.css.xhtml;...

1 Answer 1

3

There is no need to use the library attribute:

<h:outputStylesheet name="css/style.css"  />

This way, the JSF servlet expects the style.css file to be in /resources/css path.

Sign up to request clarification or add additional context in comments.

1 Comment

This is actually wrong usage of library. OP should have used <h:outputStylesheet name="css/style.css" />. See also stackoverflow.com/questions/11988415/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.