1

我正在创建使用 bootfaces 框架的 web 应用程序,为此我将BootsFaces-OSP-dist-0.6.6.jar文件放在文件WEB-INF\lib夹中。在运行我的项目时,显示的网页没有任何样式。我的项目代码是,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:b="http://bootsfaces.net/ui">

        <h:head>

        </h:head>
        <h:body>
            <b:panel look="primary">
        <f:facet name="heading">Sidebar</f:facet>   
        <b:listLinks>
            <b:navLink header="BootsFaces" />
            <b:navLink href="http://www.bootsfaces.net" value="BootsFaces"
                       icon="globe" iconAlign="right"/>
            <b:navLink></b:navLink>
            <b:navLink header="Bootstrap"/>
            <b:navLink href="http://getbootstrap.com/components/#navbar" value="Bootstrap" icon="link"></b:navLink>
            <b:navLink></b:navLink>
            <b:navLink header="Preview"/>
            <b:navLink value="Labels and Badges" outcome="/bootstrap/labelsbadge"
                       icon="tag" iconAlign="right"/>
            <b:navLink value="Slider" outcome="/jquery-ui/slider" iconAwesome="sliders" />
        </b:listLinks>
     </b:panel>
        </h:body>
    </html>

我配置了我的 web.xml 文件,例如,

<display-name>Bootfaces</display-name>
  <welcome-file-list>
    <welcome-file>index.xhtml</welcome-file>

  </welcome-file-list>
  <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>*.xhtml</url-pattern>
    <url-pattern>/javax.faces.resource/*</url-pattern>
</servlet-mapping>

任何人都建议我解决这个问题的正确方法,在此先感谢。

4

1 回答 1

0

The Bootstrap theme is disabled by default. Add this to your web.xml. See: http://www.bootsfaces.net/quick-start.jsf

<context-param>
   <param-name>BootsFaces_USETHEME</param-name>
   <param-value>true</param-value>
</context-param>
于 2015-05-16T15:33:47.940 回答