PrimeFaces 10: Legacy theme is not applied

UI Components for JSF
Post Reply
sweintritt
Posts: 5
Joined: 30 Jan 2014, 16:14
Location: Nuremberg
Contact:

07 Dec 2021, 20:44

I have moved an application from PrimeFaces 8.0 to PrimeFaces 10.0.0. The application has a legacy theme which is located at

Code: Select all

src/main/webapp/resources/primefaces-metroui
The theme is set via web.xml

Code: Select all

   <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>metroui</param-value>
    </context-param>
After switching from 8 to 10 the theme is not used any more. Only the saga theme. If I try to use any other provided PF-Theme, they also do not work. I don't get any error messages. In my browser I see that only the saga theme is loaded.
I tried to disable the theme and added my theme css in the head section of my main page

Code: Select all

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

Code: Select all

<h:outputStylesheet
    library="css"
    name="metroui.css" />
I have copied the theme.css into the css folder of my web application

Code: Select all

src/main/resources/resources/css
I can see that the file is loaded during the page load, but I don't see any change in the theme of my page.

Is there any chance the old theme will work in PF 10?
Yeah......that went well.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

08 Dec 2021, 10:16

we didnt change the handling
try to debug our HeadRenderer, if the context param is ignored

you can also check the applied CSS in your debuger tools in firefox/chrome, what exactly happens
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

sweintritt
Posts: 5
Joined: 30 Jan 2014, 16:14
Location: Nuremberg
Contact:

09 Dec 2021, 09:04

Problem was that the web.xml was not read while using the embedded Tomcat of my Spring Boot application. The application worked fine on the server. I fixed the problem by using a ServletContextInitializer to set the parameters for PrimeFaces and everything is back to normal.

I don't understand why this was an issue after the switch to PFX, because it is not related to PF but to Spring.

Thanks for the help!
Yeah......that went well.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests