【发布时间】:2014-12-03 23:01:19
【问题描述】:
我在一个 Eclipse 应用程序中遇到了 primefaces 渲染问题,但在另一个应用程序中没有。我已经比较了 web.xml 和 pom,并试图使它们相同,至少就可能影响渲染primefaces 的依赖项而言。我已经清理了有问题的项目,在 Maven 下更新了项目,检查了项目方面等,但我仍然无法让一个应用程序按照它们在另一个应用程序或展示中的外观呈现 primefaces 组件。
我使用两个 primefaces 按钮和相同的模板将页面简化为最简单的情况,而无需额外的 CSS 文件。以下是每个应用程序呈现按钮的方式:
渲染不佳,指针悬停在顶部按钮上显示
良好的渲染,适当的悬停高亮和圆角
按钮间距也不同。在糟糕的渲染中,似乎还有一些额外的边框勾勒出整个画布(白色内容区域)
方面:
<h:body>
<ui:composition template="/WEB-INF/templates/hmmcommonLayout.xhtml">
<ui:define name="title">title</ui:define>
<ui:define name="content">
<h:form>
<p:button outcome="hr" value="With Icon" icon="ui-icon-star">
<f:param name="productId" value="24" />
</p:button>
</h:form>
<h:form>
<p:button outcome="hr" icon="ui-icon-star" title="Icon Only">
</p:button>
</h:form>
<br></br>
</ui:define>
</ui:composition>
</h:body>
</html>
模板:
<?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"
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions">
<h:head>
<title><ui:insert name="title">template title</ui:insert></title>
</h:head>
<h:body>
<div class="logoText">template logo text</div>
<ui:insert name="content"></ui:insert>
</h:body>
</html>
生成的html基本相同。我还能检查什么??
【问题讨论】:
-
你检查主题了吗?它们是同一个版本吗?
标签: html jsf primefaces