Arman21
Arman21

Reputation: 103

JSF Primefaces theme change error

I've got a Maven Web Application Project where I'm using the JSF 2.2 and the Primefaces 5.3 component (Netbeans IDE 8.1).

I've used Google to understand how to Change the Default theme. I found some examples how to Change the Default theme but it didn't work.

I've right clicked the Dependencies Folder and add the cupertino theme jar. As usually the dependency got added to my pom.xml

<dependency>
    <groupId>org.primefaces.themes</groupId>
    <artifactId>cupertino</artifactId>
    <version>1.0.10</version>
</dependency>

After that I've added to my web.xml this part:

<context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>cupertino</param-value>
</context-param>

But now I've got this error:

Error loading css, cannot find "theme.css" resource of "primefaces-cupertino" library

I don't know what I did wrong.

Thanks for help Excuse my english

Upvotes: 1

Views: 1312

Answers (1)

simdevmon
simdevmon

Reputation: 693

The theme was probably not loaded, because the repository is missing.

Add the following to your pom.xml

<repositories>
    <repository>
        <id>prime-repo</id>
        <name>PrimeFaces Maven Repository</name>
        <url>http://repository.primefaces.org</url>
        <layout>default</layout>
    </repository>
</repositories> 

And run mvn clean install again on your project.

Upvotes: 2

Related Questions