English 中文(简体)
Why facelets ignore href-attribute of a link when I use <a href="url" jsfc="h:outputLink">?
原标题:
  • 时间:2009-12-04 16:52:27
  •  标签:
  • jsf
  • facelets

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.





相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签