- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我浏览了不同的来源,例如:
问题似乎已在 jsf 2.2.1 中得到修复,当我尝试使用时,我遇到了问题,以下是我的配置:
模板.xhtml:
<!DOCTYPE html>
<html lang="#{languageBean.language}"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:fn="http://xmlns.jcp.org/jsp/jstl/functions"
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions">
<!-- Enables CTRL+SHIFT+D for activating Facelets debug window -->
<ui:debug />
<f:view locale="#{languageBean.language}" encoding="UTF-8" contentType="text/html">
<!-- Client templates can insert f:metadata here, and this will NOT show up in the showcase page source code -->
<ui:insert name="meta" />
<c:set var="contextPath" value="${pageContext.request.contextPath}"
scope="application" />
<f:loadBundle var="messageResource" basename="MessageResource" />
<h:head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible"
content="EmulateIE8,IE=edge,chrome=1" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Connect" />
<meta name="keywords"
content="timeline, 3d, css, css3, css-only, transitions, responsive, fluid" />
<meta name="author" content="FriendsMirror" />
<link rel="shortcut icon"
href="#{request.contextPath}/Friendsmirror.ico" />
<ui:insert name="js"/>
<h:outputStylesheet library="css" name="common.css" />
<h:outputStylesheet library="css" name="main.css" />
<ui:insert name="css"/>
<ui:insert name="onloadScript"/>
<title><ui:insert name="title">#{messageResource['connect.main.title.main.title']}</ui:insert></title>
</h:head>
<h:body>
<ui:insert name="content" />
</h:body>
</f:view>
</html>
页面:
<ui:composition template="/WEB-INF/templates/discussion_layout.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<ui:define name="meta">
<f:metadata>
<f:viewParam name="sessionKey" value="#{discussionWrapperBean.sessionKey}" />
<f:viewParam name="ref" value="#{discussionWrapperBean.ref}" />
<f:viewParam name="pId" value="#{discussionWrapperBean.pId}" />
<f:viewParam name="dId" value="#{discussionWrapperBean.discussionId}" />
<f:viewParam name="dName" value="#{discussionWrapperBean.discussionName}" />
<f:viewAction action="#{discussionWrapperBean.loadInitDiscussion}" onPostback="false" />
</f:metadata>
</ui:define>
<ui:define name="title">
<ui:fragment rendered="#{discussionWrapperBean.profileId != null}">
#{discussionWrapperBean.userBean.firstName} #{discussionWrapperBean.userBean.lastName != null ? discussionWrapperBean.userBean.lastName: ''}#{discussionWrapperBean.pageTitleNotifications != null ? '(' : ''}#{discussionWrapperBean.pageTitleNotifications != null ? discussionWrapperBean.pageTitleNotifications : ''}#{discussionWrapperBean.pageTitleNotifications != null ? ')' : ''}
</ui:fragment>
<ui:fragment rendered="#{discussionWrapperBean.profileId == null}">
#{messageResource['connect.discussion.title']}
</ui:fragment>
</ui:define>
<ui:define name="content">
</ui:define>
</ui:composition>
Maven:
<jsf.version>2.2.1</jsf.version>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>
在 Ui 中,我遇到如下问题:The metadata component needs to be nested within a f:metadata tag. Suggestion: enclose the necessary components within <f:metadata>
甚至它没有调用 <f:viewAction>
任何建议或帮助将不胜感激。
我在部署过程中注意到的一件事:信息:初始化 Mojarra 2.2.0 (20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930) 上下文 /connectWAR
我不知道为什么这会告诉 Mojarra 2.2.0,即使我已经升级到 2.2.1
最佳答案
关于错误的UI警告,这是由Mojarra issue 2868引起的自 2.2.1 起已修复。
至于<f:viewAction>
仍然无法在 2.2.1 上工作,这是自 Java EE 7 引入以来的另一个 Mojarra 错误 xmlns.jcp.org
XML 命名空间域导致了这个问题。特别是在 Mojarra 版本 2.2.0 和 2.2.1 中,新的 XML 命名空间域未正确注册所有新的 JSF 2.2 特定标记,这些标记在 JSF 2.0/2.1 中不存在,例如 <f:viewAction>
。实际上,xmlns.jcp.org
在 Mojarra 2.2.0/2.2.1 中,仅会返回 JSF 2.1 兼容标记。这完全解释了为什么新的 JSF 2.2 <f:viewAction>
不适合你。
您有 2 个选择:
使用“旧”java.sun.com
XML 命名空间域代替。新的 JSF 2.2 特定标记已在那里正确注册。
至少升级到 Mojarra 2.2.2。这个特殊的错误自该版本以来已得到修复。莫贾拉是 currently已经是 2.2.4。
关于jsf - 元数据组件需要嵌套在 f :metadata tag. 建议:将必要的组件包含在 <f:metadata> 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17945943/
我正在使用 this solution在二进制矩阵中找到与图像边界对齐的矩形。假设现在我想找到一个不与图像边框对齐的矩形,并且我不知道它的方向;找到它的最快方法是什么? 为了示例,让我们寻找一个仅包含
else: 行在这个 Python 程序中是否正确/必要? from random import randrange for n in range(10): r = randrange(0,1
在 TDPL 7.1.5.1 中讨论了将 Widget w2 分配给 w1 并且作者指出“将 w2 逐个字段分配给 w1 会将 w2.array 分配给 w1.array——一个简单的数组边界分配,而
我是一名优秀的程序员,十分优秀!