【发布时间】:2011-12-10 15:08:56
【问题描述】:
我看到过here 和here 提出的类似问题。这些都没有回答我的问题。我也搜索了PrimeFaces forum。
在 NetBeans 中设置一个普通的 JSF 2.0 项目,我添加了 Simple Dialog 的展示代码。
代码(index.xhtml)减去 xml 声明和 DOCTYPE(XHTML 1.0 过渡):
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<title>PrimeFaces</title>
</h:head>
<h:body>
<h:panelGrid columns="1" cellpadding="5">
<p:commandButton value="Basic" onclick="dlg1.show();" type="button"/>
<p:commandButton value="Modal" onclick="dlg2.show();" type="button"/>
<p:commandButton value="Effects" onclick="dlg3.show();" type="button"/>
</h:panelGrid>
<p:dialog header="Basic Dialog" widgetVar="dlg1">
<h:outputText value="Resistance to PrimeFaces is futile!" />
</p:dialog>
<p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" height="200">
<h:outputText value="This is a Modal Dialog." />
</p:dialog>
<p:dialog header="Effect Dialog" widgetVar="dlg3" showEffect="bounce" hideEffect="explode" height="200">
<h:outputText value="This dialog has cool effects." />
</p:dialog>
</h:body>
我已将aristo 主题添加到我的Libraries(NetBeans 添加到类路径的方式)并将以下内容添加到web.xml
web.xml(部分):
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>aristo</param-value>
</context-param>
没有进行其他更改,尽管我快速安装/卸载了另一个主题(dark-hive)只是为了确保主题已正确注册。结果如下:
本地(Chrome 15.0.874.92):
展示:(来自PrimeFaces Showcase)
堆栈:
PrimeFaces 2.2.1
JSF 2.0
Glassfish 3.1.1
Java 1.6.0_18
Windows 7 x64
(由 NetBeans 7.0.1 生成)
编辑:这也在 FireFox 7.0.1 和 IE 9 上进行了测试
【问题讨论】:
-
您能否提供有关“我已将 aristo 主题添加到我的库”的更多详细信息。您是否将 jar 添加到项目的库中或创建了库?如果您构建项目并探索 war 文件(在文件资源管理器中),您会看到预期的结果吗?
-
@vkraemer 我从我的库中添加了 JSF/PrimeFaces 插件中包含的 jar。它位于
<NB_INSTALL>/enterprise/modules/ext/primefaces/primefaces-2.2.1.jar。是的,我看到了我对已部署目录的期望(NetBeans 执行就地部署)。不过这是一个很好的观点,我将从 PrimeFaces.org 下载该库,看看是否有变化。 -
@vkraemer 切换到下载的 jar 后,我看不到任何变化。
-
我还将它部署到服务器(而不是就地)。没有变化
标签: css jsf primefaces