0
我正在設計一個網站,其中我想在所有頁面中包含我的Navbar
,問題是我每寫navbar
代碼裏面的ui:composition
標籤就會比bootstrap
熄滅。沒有這個標籤,一切工作正常。Bootstrap不能在UI組合標籤下工作JSF
工作碼
<?xml version="1.0" encoding="UTF-8"?>
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
<h:head>
<title>JSF 2.x Page</title>
<meta http-equiv="keywords" content="enter,your,keywords,here" />
<meta http-equiv="description"
content="A short description of this page." />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<h:outputStylesheet library="css" name="black.css" />
<h:outputStylesheet library="css" name="bootstrap.css" />
<h:outputScript library="js" name="bootstrap.js" />
<h:outputScript library="js" name="bootstrap.min.js" />
</h:head>
<h:body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">My Task</a>
</div>
<button class="btn btn-success navbar-btn">Projects</button>
<button class="btn btn-success navbar-btn">Objects</button>
<button class="btn btn-success navbar-btn">Properties</button>
<button class="btn btn-success navbar-btn">Property Types</button>
</div>
</nav>
</h:body>
</html>
但隨着ui:composition
,自舉工作不
<?xml version="1.0" encoding="UTF-8"?>
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
<h:head>
<title>JSF 2.x Page</title>
<meta http-equiv="keywords" content="enter,your,keywords,here" />
<meta http-equiv="description"
content="A short description of this page." />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<h:outputStylesheet library="css" name="black.css" />
<h:outputStylesheet library="css" name="bootstrap.css" />
<h:outputScript library="js" name="bootstrap.js" />
<h:outputScript library="js" name="bootstrap.min.js" />
</h:head>
<h:body>
<ui:composition>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">My Task</a>
</div>
<button class="btn btn-success navbar-btn">Projects</button>
<button class="btn btn-success navbar-btn">Objects</button>
<button class="btn btn-success navbar-btn">Properties</button>
<button class="btn btn-success navbar-btn">Property Types</button>
</div>
</nav>
</ui:composition>
</h:body>
</html>
是不是c在UI之外的ode:compsition忽略?你爲什麼不使用模板並在那裏放置引導程序?看到這裏:http://stackoverflow.com/questions/6525050/understand-the-purpose-of-jsf-uicomposition – Tim
一切都被忽略內部或外部的組成標籤 –
它不是真的一個問題 - 代碼之外的標籤將被忽略。因此,我建議使用包含boostrap和您的作文的模板 –
Tim