开发者

Why facelets ignore href-attribute of a link when I use <a href="url" jsfc="h:outputLink">?

开发者 https://www.devze.com 2022-12-13 02:14 出处:网络
I have next facelet composition: <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">

I have next facelet composition:

<!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">
<body>
    <ui:composition>
        <ul id="navigation">
            <li>
                <a href="http://google.com" id="google1" jsfc="h:outputLink">google.com</a>
            </li>
            <li>
                <h:outputLink id="google2" value="http://google.com">
                    <h:outputText id="outputtext" value="google.com"/>
                </h:outputLink>
            </li>
        </ul>
    </ui:composition>
</body>
</html>

There must be a mistake because what I expected to see is almost the same final html-markup. But actually here is what facelets generated:

<ul id="navigation"> 
    <li><a id="google1" name="google1" href="">google.com</a></li> 
    <li><a id="google2" name="google2" href="http://google.com"><span id="outputtext">google.com</span></a> 
    </li> 
</ul> 

Why it ignored href attribute of the first link? What is the correct way to do what I'm trying to do?


One more additional question: if I'm using jsfc everywhere I can then what should I do with components from f: namespace? Where should be <f:view> placed? Maybe in the 开发者_运维知识库template.xhtml? Or I should simply ignore it?


Might be a bug in facelets. Besides, why don't you just omit that attribute? simple <a href suits you.

0

精彩评论

暂无评论...
验证码 换一张
取 消