简体   繁体   English

如何使facelets符合XHTML 1.0 Transitional?

[英]How to make facelets conform to XHTML 1.0 Transitional?

Why can't facelets XHTML files be valid XHTML 1.0 Transitional files? 为什么facelets XHTML文件不能有效XHTML 1.0 Transitional文件? If I submit a facelet file in an xml validator (eg w3c validator) it shows an error on the first tag defined in one of the taglibs. 如果我在xml验证器(例如w3c验证器)中提交facelet文件,则会在其中一个taglib中定义的第一个标签上显示错误。

Example 1: 例1:

If I submit the following file to the validator, it shows no error, validation goes fine because no taglib tags appear in the document (one jsf taglib is defined though). 如果我将以下文件提交给验证器,它没有显示错误,验证正常,因为文档中没有出现taglib标签(虽然定义了一个jsf taglib)。

<?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:h="http://java.sun.com/jsf/html">
<head>
<title></title>
</head>
<body>
</body>
</html>

Example 2: 例2:

Now I just inserted the h:head and h:body tags from the xmlns:h namespace but this causes errors in the validation. 现在我只是从xmlns:h命名空间插入h:head和h:body标签,但这会导致验证错误。

<?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:h="http://java.sun.com/jsf/html">
<h:head>
<title></title>
</h:head>
<h:body>
</h:body>
</html>

Certainly I'm missing something fundamental here, but I still can't figure out what. 当然我在这里缺少一些基本的东西,但我仍然无法弄清楚是什么。

This is my first question here at SO so please point out any errors, thank you! 这是我在SO的第一个问题所以请指出任何错误,谢谢!

If you check the Lifecycle of a Facelets Application you can see that your view is rendered to the client. 如果您检查Facelets应用程序生命周期,您可以看到您的视图呈现给客户端。 This will transform tags like <h:head> replacing them with their xhtml equivalent eg <head> . 这将转换像<h:head>这样的标签,用它们的xhtml等效替换它们,例如<head> If you want templates that are XHTML valid you may want to try with the jsfc attribute but it has its drawbacks. 如果你想要XHTML有效的模板,你可能想尝试使用jsfc属性,但它有它的缺点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何让JSF渲染符合XHTML 1.0严格? - How to let JSF render conform XHTML 1.0 strict? 如何使用 JSF 2.0 Facelets 在 XHTML 中包含另一个 XHTML? - How to include another XHTML in XHTML using JSF 2.0 Facelets? 如何使facelets工作? - How to make facelets work? 如何使用Eclipse IDE在XHTML中使用facelets开发应用程序? - How to develop application using facelets in XHTML by the Eclipse IDE? 如何以编程方式在UIComponent(例如PanelGroup)中插入xhtml-facelets - How to insert xhtml-facelets in UIComponent (e.g. PanelGroup) programmatically 如何在IBM Rational Application Developer for Websphere 8.5中创建JSF(XHTML)facelets页面 - How to create a JSF (XHTML) facelets page in IBM Rational Application Developer for Websphere 8.5 使用facelets(jsf)和xhtml进行Eclipse自动完成(内容辅助) - Eclipse autocomplete (content assist) with facelets (jsf) and xhtml 在使用Richfaces和Facelets开发.xhtml文件时,如何删除在Eclipse的Java构建路径中找不到的Message Ui:include? - How to remove Message Ui:include not found on java build path in eclipse, While developing .xhtml file using richfaces and facelets? 如何使Netbeans 6.7识别Facelets中的JSF标签? - How can I make Netbeans 6.7 recognize JSF tags in facelets? 在JSF2项目中混合使用JSP和XHTML(Facelets) - 可能吗? - Mixing JSP and XHTML (Facelets) in JSF2 Project - possible?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM