2
在我的JSF项目中,我尝试使用JSF传递来利用HTML5兼容标记,而不是PrimeFaces组件。但它似乎会导致额外的结束标记为空元素,如小时,img,br,打破我的布局。JSF传递元素导致杂散结束标记
这是我的代码,完整。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsf="http://xmlns.jcp.org/jsf">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>JSF Passthrough Test</title>
</head>
<body>
<form>
<input id="inputSearch" size="40" value=""/>
<button type="button" class="btn btn-default" jsf:id="searchbutton">
<span class="glyphicon glyphicon-search"></span> Find
</button>
</form>
<img src="http://i.imgur.com/atz81.jpg" alt="Cat + Unicorn"/>
</body>
</html>
这个提供给浏览器的是一个额外的关闭img标签,用于我后面的图像。 (如果我在按钮之前移动图像,没问题。)
<img src="http://i.imgur.com/atz81.jpg" alt="Cat + Unicorn" />
</img>
有什么我在这里失踪或做错了吗?谢谢。