您是否知道为什么在div中包装后不会呈现以下outputText组件?
<?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>Welcome</title>
</h:head>
<h:body>
<div>
<h:outputText>This line will not be rendered</h:outputText>
</div>
</h:body>
</html>
例如,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"><head>
<title>Welcome</title></head><body>
<div>
</div></body>
</html>
答案 0 :(得分:3)
<h:outputText value="This line will be rendered"/>
请参阅http://www.jsftoolbox.com/documentation/help/12-TagReference/html/h_outputText.html