2

I want to use Bootsfaces for JSF, I was checking their website and I follow the steps to start working with it but when I run my app the CSS it´s not loading.

My project is on Maven also.

  1. I download the JAR from their website.
  2. I load that JAR to my project
  3. I put the code from the example

But the css is not working, any idea, has anyone worked with this before?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
kennechu
  • 1,412
  • 9
  • 25
  • 37

2 Answers2

1

I'm starting on bootfaces too. For me, it seems to be best designed face for JSF.

About your problem, did you inserted the xmlns line on the HTML tag? This one:

xmlns:b="http://bootsfaces.net/ui"

Your HTML tag should look like this:

<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:b="http://bootsfaces.net/ui"
    xmlns:f="http://xmlns.jcp.org/jsf/core">

I hope it helps you!

Simple Sandman
  • 900
  • 3
  • 11
  • 34
Guerino Rodella
  • 321
  • 4
  • 16
  • Yes it´s really cool. wich server are you using to run your apps? I was trying with Tomcat but a friend told me that I should try Glassfish but the result was the same. for now let me try with the your tags.. thanks! – kennechu Nov 27 '14 at 20:38
  • Glassfish, for sure! Glassfish seems to be better, not for bootfaces or any faces, but for JSF framework. It has built in implementation of JSF. Tomcat is not strong as Glassfish is. I didn't took the proof by myself, but I heard glaassfish has a better performance compared to Tomcat. – Guerino Rodella Nov 28 '14 at 13:34
  • Since BootsFaces 0.6.5 we develop and test BootsFaces with a variety of servers and implementations: Tomcat, GlassFish, WildFly and TomEE, and Mojarra, Apache MyFaces, PrimeFaces, OmniFaces and AngularFaces. So the choice of server shouldn't matter. Theoretically :). – Stephan Rauh Feb 27 '15 at 19:15
-1

I used to have this problem.

First, check that web.xml is similar to:

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<!-- Welcome page -->
<welcome-file-list>
    <welcome-file>faces/welcome.xhtml</welcome-file>
</welcome-file-list>

<!-- Map these files with JSF -->
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/javax.faces.resource/*</url-pattern>
</servlet-mapping>

</web-app>

Second, did you use commands clean, compile, install already? If not please run them.

doelleri
  • 19,232
  • 5
  • 61
  • 65
  • You don't need all those ```url-patterns``` if you use the ```CombinedResourceHandler``` of OmniFaces or the ```UnmappedResourceHandler``` of BootsFaces. – Stephan Rauh Apr 17 '15 at 15:26