1

login.xhtml ファイルがあります

<!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"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<f:event listener="#{seguridadMB.doManageEvents}" type="preRenderView" />
<h:body>
    <h:outputStylesheet name="css/default.css" />
    <h:outputStylesheet name="css/jquery-silk-icons.css" />
    <h:form prependId="false" id="form_login">
    <p:growl id="messages" />
    <p:panelGrid columns="2" styleClass="center">
        <f:facet name="header">
            <h:outputLabel value="#{msg['login.dialogTitle']}" />
        </f:facet>

        <h:outputLabel for="j_username" value="#{msg['login.username']}: *" />
        <p:inputText id="j_username" value="#{seguridadMB.username}"
            required="true" label="#{msg['login.username']}" />

        <h:outputLabel for="j_password" value="#{msg['login.password']}: *" />
        <p:password id="j_password" value="#{seguridadMB.password}"
            required="true" label="#{msg['login.password']}" />

        <f:facet name="footer">
            <div class="column-center">
                <p:commandButton type="submit" ajax="false"
                    value="#{msg['login.signin']}" icon="silk-icon-door-in"
                    action="#{seguridadMB.doLogin}" style="margin:0" update="messages" />
            </div>
        </f:facet>

    </p:panelGrid>
</h:form>

そして、domコンポーネントツリーを印刷するためのこのユーティリティがあります:

http://www.jroller.com/cschalk/entry/a_jsf_phaselistener_to_print

出力は次のとおりです。

20:08:17,522 INFO  [stdout] (http-localhost-127.0.0.1-8180-4) j_id1 (javax.faces.component.UIViewRoot)
20:08:17,522 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   |
20:08:17,523 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   j_idt1 (com.sun.faces.facelets.compiler.UIInstructions)
20:08:17,523 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   |
20:08:17,524 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   j_idt2 (com.sun.faces.facelets.compiler.UIInstructions)
20:08:17,524 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   |
20:08:17,525 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   j_idt3 (javax.faces.component.UIOutput)
20:08:17,525 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   |
20:08:17,526 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   j_idt4 (javax.faces.component.html.HtmlBody)
20:08:17,526 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)     |
20:08:17,527 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)     form_login (javax.faces.component.html.HtmlForm)
20:08:17,528 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)       |
20:08:17,528 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)       messages (org.primefaces.component.growl.Growl)
20:08:17,529 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)       |
20:08:17,529 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)       j_idt7 (org.primefaces.component.panelgrid.PanelGrid)
20:08:17,530 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         |
20:08:17,531 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         j_idt9 (javax.faces.component.html.HtmlOutputLabel)
20:08:17,532 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         |
20:08:17,532 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         j_username (org.primefaces.component.inputtext.InputText)
20:08:17,533 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         |
20:08:17,534 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         j_idt10 (javax.faces.component.html.HtmlOutputLabel)
20:08:17,534 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         |
20:08:17,535 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)         j_password (org.primefaces.component.password.Password)
20:08:17,536 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   |
20:08:17,536 INFO  [stdout] (http-localhost-127.0.0.1-8180-4)   j_idt12 (com.sun.faces.facelets.compiler.UIInstructions)

しかし、これが f:facet タグ内のコンポーネントを出力しない理由がわかりません。(最初のh:outputLabel...p:commandButton...は出力されません - f:facet タグ内のコンポーネントのみ)

f:facet 内のコンポーネントにアクセスするには?

助けてください

ありがとう

4

1 に答える 1