Recaptcha does not render

Asked

Viewed 317 times

1

I’m trying to put a recap in my view, but it doesn’t render at all and the following exception appears:

Warning: JSF1090: Unresolved navigation case for the component j_idt200.

View

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

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />    
        <script src='https://www.google.com/recaptcha/api.js?hl=pt-BR'></script>
    </h:head>

    <h:body>

            <p:layoutUnit id="centerLayoutUnit" position="center" style="top: 70px;">
                <h:form id="centerForm" >
                    <p:messages id="mensagens" autoUpdate="true" closable="true"/>

                    <p:outputPanel id="cadastro">
                        <p:outputPanel rendered="#{registroOnlineEmpresaController.renderizaCadastro}">
                            <p:wizard id="wizardForm" widgetVar="wizardForm" backLabel="Voltar" nextLabel="Próximo" showStepStatus="false"
                                      binding="#{registroOnlineEmpresaController.wizardForm}" showNavBar="false">

    <!-- PARTE OCULTADA -->

                                <p:tab id="tabAnexoArquivos" title="Confirmação e Envio de Documentos">
                                    <p:panel id="anexoArquivos" header="Confirmação e Envio de Documentos">
                                        <h:outputText value="AVISO: Será enviada uma mensagem no email cadastrado 
                                                  com data de agendamento para apresentação dos documentos originais" 
                                                  style="color: #f00; font-weight: bold;"/>

                                        <br />
                                        <br />

                                        <fieldset>
                                            <legend>
                                                <h:outputLabel value="Anexar Arquivos" style="font-weight: bold"/>
                                            </legend>

                                            <p:outputPanel id="tipoDocumento">
                                                <p:outputPanel rendered="#{registroOnlineEmpresaController.tipoProtocoloSelecionado != null}">
                                                    <ul>
                                                        <ui:repeat value="#{registroOnlineEmpresaController.obterTiposDocumentosObrigatorios()}" var="itemTipoDocumento">
                                                            <li>
                                                                <p:commandLink value="#{itemTipoDocumento.descricao}" actionListener="#{registroOnlineEmpresaController.abrirAnexosTiposDocumentosObrigatorios(itemTipoDocumento)}"
                                                                    immediate="true" update="@([id$=tipoDocumento], [id$=panelTiposDocumentos])" title="Clique para anexar arquivos"/>
                                                            </li>

                                                            <ui:repeat value="#{registroOnlineEmpresaController.recuperarArquivosAnexados(itemTipoDocumento)}"
                                                                       var="itemArquivoAnexado">

                                                                <li style="margin-left: 20px;">
                                                                    <h:outputText value="#{itemArquivoAnexado.nomeArquivo}" style="margin-right: 1px;"/>
                                                                    <p:commandLink actionListener="#{registroOnlineEmpresaController.excluirAnexo(itemArquivoAnexado)}"
                                                                    style="margin-right: 3px;" immediate="true" update="@([id$=tipoDocumento])">
                                                                        <p:graphicImage alt="Excluir" value="../imagens/site/delete.png" />
                                                                    </p:commandLink>
                                                                </li>

                                                            </ui:repeat>
                                                        </ui:repeat>
                                                    </ul>

                                                    <br />
                                                    <br />

                                                    <p:outputPanel rendered="#{registroOnlineEmpresaController.renderizaMenuTodosOsTiposDocumentos}">
                                                        <h:outputLabel value="Tipo de Documento *: " style="font-weight: bold" />
                                                        <h:selectOneMenu id="tiposDocumentos" style="height: 20px; width: 200px; background-color: #fff;"
                                                                         converter="tipoDocumentoRegistroOnlineEmpresaConverter"
                                                                         required="true" requiredMessage="Tipo de Documento: Preenchimento Obrigatório"
                                                                         validator="#{registroOnlineEmpresaController.validatorTeste}"
                                                                         validatorMessage="Tipo de Documento Inválido">
                                                            <f:selectItem noSelectionOption="true" itemLabel="Selecione..." />
                                                            <f:selectItems value="#{tipoDocumentoController.tiposDocumentos}"
                                                                           var="tipoDocumento" itemValue="#{itemTipoDocumento}" itemLabel="#{tipoDocumento.descricao}" />
                                                            <p:ajax event="change" process="@this" />

                                                        </h:selectOneMenu>
                                                    </p:outputPanel>

                                                    <br />

                                                    <p:outputPanel style="width: 300px;" rendered="#{registroOnlineEmpresaController.renderizaFileUpload}">
                                                        <h:outputLabel value="Anexo de Arquivos *:" style="font-weight: bold" />

                                                        <br />
                                                        <br />

                                                        <p:fileUpload id="uploadAnexo"
                                                                      fileUploadListener="#{registroOnlineEmpresaController.handleFileUpload}"
                                                                      allowTypes="/(\.|\/)(gif|png|jpe?g|pdf)$/"
                                                                      sizeLimit="10000000"
                                                                      label="Escolher..."
                                                                      multiple="true"
                                                                      auto="true"
                                                                      showButtons="false"
                                                                      mode="advanced"
                                                                      uploadLabel="Enviar Arquivos"
                                                                      process="@this"
                                                                      dragDropSupport="true"
                                                                      required="true"
                                                                      invalidFileMessage="Arquivo Inválido! Anexe apenas imagem e/ou PDFs"
                                                                      invalidSizeMessage="Tamanho inválido! Tamanho máximo 10MB"
                                                                      requiredMessage="Anexe pelo menos um arquivo"
                                                                      update="tipoDocumento"/>

                                                        <br />
                                                        <br />

                                                        <p:commandButton icon="voltar" value="Voltar" update="tipoDocumento" immediate="true"
                                                                         actionListener="#{registroOnlineEmpresaController.voltarAnexo()}"/>
                                                    </p:outputPanel>
                                                </p:outputPanel>
                                            </p:outputPanel>

                                        </fieldset>

                                        <br />
                                        <br />

                                        <h:selectBooleanCheckbox value="#{registroOnlineEmpresaController.aceitacaoTermos}"
                                                                 title="Aceito o Termo de Responsabilidade"
                                                                 validator="#{registroOnlineEmpresaController.validarAceitacaoTermos}"/>

                                        <h:outputLabel value="Aceito o " style="font-weight: bold"/>

                                        <h:link target="blank" outcome="termoResponsabilidadeEmpresa" value="Termo de Responsabilidade" 
                                                style="font-size: 11px; font-weight: bold;"/>

                                        <br />
                                        <br />

                                        <h:panelGrid style="text-align: left;margin-left: 10px;">
                                            <div class="g-recaptcha" data-sitekey="MY_KEY"></div> 
                                        </h:panelGrid>

                                        <br />
                                        <br />

                                        <p:commandButton icon="adicionar" value="Enviar Cadastro"
                                                         action="#{registroOnlineEmpresaController.gerarRegistro()}" />
                                    </p:panel>
                                </p:tab>
                            </p:wizard>

                            <p:outputPanel autoUpdate="true">
                                <p:commandButton value="Voltar" icon="voltar" immediate="true" actionListener="#{registroOnlineEmpresaController.onBack()}"
                                                 rendered="#{registroOnlineEmpresaController.renderizaBotaoVoltar}"/>
                                <p:commandButton value="Próximo" icon="proximo" actionListener="#{registroOnlineEmpresaController.onNext()}"
                                                 style="float: right" rendered="#{registroOnlineEmpresaController.renderizaBotaoProximo}"/>
                            </p:outputPanel>
                        </p:outputPanel>
                    </p:outputPanel>
                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="south" size="30" footer="© 2019 Todos os direitos reservados." resizable="false" closable="false" collapsible="false">
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>

Link to the Stacktrace

  • Why not use the p:captcha?

  • @nullptr, This also presented the same problem when tested

  • 1

    It would have to post the entire stack trace for more detail of the error?

  • Which version of JSF and JEE is using?

  • @Muriloportugal, I edited the question with stacktrace

  • @nullptr, JEE 6 and JSF (Mojarra) 2.1.6

  • If I put the recaptcha inside h:body, but outside p:layout, it normally renders

  • @Julianamarques, just to clear the doubt that the problem really is in recaptcha, could you please check if without recaptcha the warning Advertência: JSF1090: Caso de navegação não resolvido para o componente j_idt200 still appears in stacktrace?

  • @Muriloportugal, does not appear

Show 4 more comments

1 answer

1

I would put as a comment, but I don’t have enough points...

A user of the international version of Stackoverflow, was having the same problem "Warning: JSF1090", follows the question link with the solution -> link.

According to the author of the answer with the solution:

"This notice will occur whenever you use a navigation result (implicit) in the Outcome attribute of <h:link> or <h:button> , that does not represent a valid display ID."

"In addition, the <h:link> renders an element <span> instead of an element <a> .

The solution is obvious: use a valid display ID or make sure that the desired view can be solved by ConfigurableNavigationHandler#getNavigationCase().

Note that some beginners use, for an unknown reason, even a full URL like http://google.com as a result of <h:link> :

<h:link value="Go to Google" outcome="http://google.com" /> 

This abuse would also produce exactly this warning. You should use <h:outputLink> or just <a> .

As for the absence of an HTML element with the same ID as the JSF component, this can happen when you have not explicitly specified the id attribute of the JSF component. The ID of the JSF component does not necessarily end in the generated HTML output. Assigning a fixed ID to these components should help better identify the cause."

I hope I’ve helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.