Theme Sapphire Installation

Post Reply
User avatar
afterbit
Posts: 83
Joined: 19 Mar 2012, 23:51
Contact:

18 Apr 2019, 14:22

Hello,

I bought the sapphire theme .. I followed the guide to: https://www.primefaces.org/sapphire/docs.xhtml
I hope I have taken all the necessary steps ... but when I run the test webbapp, I get the errors:

com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource JSF1064: Unable to find or serve resource, theme.css, from library, primefaces-primefaces-sapphire-blue.
18-Apr-2019 12:11:39.271 GRAVE [http-nio-8080-exec-10] com.sun.faces.application.view.FaceletViewHandlingStrategy.handleRenderException Error Rendering View[/index.xhtml]
javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-primefaces-sapphire-blue" library
at org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:150)

...
....
com.sun.faces.context.ExceptionHandlerImpl.log JSF1073: javax.faces.FacesException caught during processing of RENDER_RESPONSE 6 : UIComponent-ClientId=, Message=Error loading css, cannot find "theme.css" resource of "primefaces-primefaces-sapphire-blue" library
18-Apr-2019 12:11:39.322 1100 [http-nio-8080-exec-10] com.sun.faces.context.ExceptionHandlerImpl.log Error loading css, cannot find "theme.css" resource of "primefaces-primefaces-sapphire-blue" library
javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-primefaces-sapphire-blue" library

...

etc.. etc...


this is a Netbeans screenshot where I text my webapp:

Image


what am I doing wrong?

mert.sincan
Posts: 4569
Joined: 29 Jun 2013, 12:38

18 Apr 2019, 15:44

Please use in web.xml;

Code: Select all

sapphire-blue // instead of primefaces-sapphire-blue
Best Regards,

User avatar
afterbit
Posts: 83
Joined: 19 Mar 2012, 23:51
Contact:

18 Apr 2019, 16:15

thank you... now the error has disappeared ..

i open the url : http://localhost:8080/PrimefacesThemeTest/login.xhtml

but the page is incorrectly rendered .. the error is:

[http-nio-8080-exec-1] com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource JSF1064: Unable to find or serve resource, css/layout-.css, from library, sapphire-layout.

the web.xml is now :

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
  <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
  </context-param>
  <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
  </context-param>
  <context-param>
    <param-name>primefaces.LEGACY_WIDGET_NAMESPACE</param-name>
    <param-value>true</param-value>
  </context-param>
    
  <context-param>
    <param-name>primefaces.FONT_AWESOME</param-name>
    <param-value>true</param-value>
  </context-param>

  <context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>sapphire-blue</param-value>
  </context-param>

  <context-param>
    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
    <param-value>true</param-value>
  </context-param>
    
    
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    <url-pattern>*.jsf</url-pattern>
    <url-pattern>*.xhtml</url-pattern>
  </servlet-mapping>
  <session-config>
    <session-timeout>
      30
    </session-timeout>
  </session-config>
  <welcome-file-list>
    <welcome-file>faces/index.xhtml</welcome-file>
  </welcome-file-list>
</web-app>

User avatar
afterbit
Posts: 83
Joined: 19 Mar 2012, 23:51
Contact:

18 Apr 2019, 16:53

solved.. missing Guest Preferences bean..
the xhtml pages refer to it..
so i created the package org.primefaces.sapphire.view and copied it from the sources of the sapphire zip
(maybe it's just my case.. but it is a good idea to update the docs... .maybe..)

mert.sincan
Posts: 4569
Joined: 29 Jun 2013, 12:38

19 Apr 2019, 15:47

Thanks a lot for the update! If Guest Preferences is unnecessary for you, please remove it. We added it for loading dynamic resources. Please use;

Code: Select all

Exp;
<h:outputStylesheet name="css/layout-blue.css" library="sapphire-layout" />

instead of 

<h:outputStylesheet name="css/layout-#{guestPreferences.layout}.css" library="sapphire-layout" />
Best Regards,

User avatar
afterbit
Posts: 83
Joined: 19 Mar 2012, 23:51
Contact:

19 Apr 2019, 16:08

Thanks!
R.

mert.sincan
Posts: 4569
Joined: 29 Jun 2013, 12:38

22 Apr 2019, 08:49

You're welcome!

Post Reply

Return to “Sapphire - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest