CSSを1ページの読み込みで読み込むことは可能ですか?1ページの読み込みCSS
Webアプリケーション用にJSF/Primefacesを使用したシングルページ方式を使用しています。私は1ページを変更するとCSSを読み込むことはできません。
ご意見はありますか?
編集: 私はあなたが私の単一のページを更新するために含んで見ることができます
<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:p="http://primefaces.org/ui">
<f:view />
<h:head>
<f:facet name="first">
xxx
</f:facet>
</h:head>
<h:body>
<f:facet name="last">
<h:outputStylesheet name="/ressources/css/default.css" />
</f:facet>
<!-- ...etc -->
<p:layout fullPage="true">
<p:layoutUnit position="center">
<h:form id="contentForm">
<ui:include id="spa_content" src="ressources/fragments/#{myBean.currentPage.fragment()}.xhtml" />
</h:form>
</p:layoutUnit>
</p:layout>
</h:body>
</html>
でいるindex.xhtmlを持っています。そして、私のdefault.css
default.css使用して、ファセット "最後":
.ui-button-text {
background-color: green;
color : blue;
}
を私は管理Beanを持っている:
@ManagedBean(name = "xxx")
@SessionScoped
public class MyBean extends AbstractSessionBean implements Serializable {
public MyBean() {}
@PostConstruct
private void init() {}
//...etc
}
は最後に、私はmySinglePage.cssおよびフラグメントを持っていますmySinglePage.xhtml:
mySinglePage.xhtml:
<ui:composition 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:p="http://primefaces.org/ui">
<f:facet name="last">
<h:outputStylesheet name="/ressources/css/mySinglePage.css" />
</f:facet>
<p:commandButton value="#{xxx}" action="#{xxx}" update="xxx"/>
</ui:composition>
あなたは...それは働いていないmySinglePage.cssを使用するために、最後の面を見ることができますが、
mySinglePage.css:私はmySinglePageを使用する方法がわからない
.ui-button-text {
background-color: red;
color : yellow;
}
.css
編集2:私はこれを持っている場合、それは動作しますが、私の同僚は、それがsinglepageないと言う
:
<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:p="http://primefaces.org/ui">
<f:view />
<h:head>
<f:facet name="first">
xxx
</f:facet>
</h:head>
<h:body>
<f:facet name="last">
<h:outputStylesheet name="/ressources/css/default.css" />
</f:facet>
<!-- ...etc -->
<p:layout fullPage="true">
<p:layoutUnit position="center">
<ui:insert name="contenu">
<ui:include src="/ressources/fragments/mySinglePage.xhtml"
/>
</ui:insert>
</p:layoutUnit>
</p:layout>
</h:body>
</html>
と
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<h: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:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
<ui:composition template="../../index.xhtml">
<ui:define name="contenu">
<f:facet name="last">
<h:outputStylesheet name="/ressources/css/mySinglePage.css"
/>
</f:facet>
<p:commandButton value="BLOP"/>
</ui:define>
</ui:composition>
</h:body>
</h:html>
それは良い方法であれば、あなたは知っていますか?
ありがとうございました。
_「1ページの読み込みでCSSを読み込むことができます」_はい – Kukeltje
ありがとう:)それは始まりです。 「あなたは考えていますか?」私はいくつかのことをしようとしているのでチュートリアルとのリンクはありますが、うまくいきません。 – Paladice
[ask]を読んでください... [mcve]が含まれていなければ問題はありません。 。チュートリアルへのリンクについての質問は、stackoverflowのためのオフトピックです....乾杯。 – Kukeltje