Componentes PrimeFaces não aparecem [Resolvido]

7 respostas
L

Olá
Sempre que eu uso o prime face sno meu projeto eu coloco os componentes e o resultado é uma página em branco.
Eu já peguei exemplos de codigo feito pra testar como esse abaixo.
Alguem sabe o que pode ser. Alguma configuração do projeto ou outra coisa qualquer?

<?xml version='1.0' encoding='UTF-8' ?>
<!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:prime="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <prime:layout fullPage="true">
            <prime:layoutUnit position="top" header="Teste">
                <h:panelGrid columns="1" cellpadding="5">
                    <prime:commandButton value="Basic" onclick="dlg1.show();" type="button"/>
                    <prime:commandButton value="Modal" onclick="dlg2.show();" type="button"/>
                    <prime:commandButton value="Effects" onclick="dlg3.show();" type="button"/>
                </h:panelGrid>

                <prime:dialog header="Basic Dialog" widgetVar="dlg1">
                    <h:outputText value="Resistance to pFaces is futile!" />
                </prime:dialog>

                <prime:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" height="200">
                    <h:outputText value="This is a Modal Dialog." />
                </prime:dialog>

                <prime:dialog header="Effect Dialog" widgetVar="dlg3" showEffect="bounce" hideEffect="explode" height="200">
                    <h:outputText value="This dialog has cool effects." />
                </prime:dialog>
            </prime:layoutUnit>
        </prime:layout>
    </h:body>
</html>

7 Respostas

P

Dica: quando for postar codigo no forum coloque entre as tags [code].

Como voce está chamando a url?

A

se possível, cola o Log do server aqui tbm…

L

Pelo que eu vi num da nenhuma Exception.
Mas na página todos os componentes que eu uso a tag do prome faces não aparecem
ja troquei de servidor (apache e glassfish) usei 2 versões do netBeans, 2 versões do prime faces
meus amigos que usam o prime faces tambem num descobrem o que é

18/10/2010 12:40:55 com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform
Welcome to Felix

INFO: Perform lazy SSL initialization for the listener 'http-listener-2’

INFO: Starting Grizzly Framework 1.9.18-o - Mon Oct 18 12:40:59 AMT 2010

INFO: Starting Grizzly Framework 1.9.18-o - Mon Oct 18 12:40:59 AMT 2010

INFO: Grizzly Framework 1.9.18-o started in: 156ms listening on port 4848

INFO: Grizzly Framework 1.9.18-o started in: 141ms listening on port 3700

INFO: Grizzly Framework 1.9.18-o started in: 203ms listening on port 8080

INFO: Grizzly Framework 1.9.18-o started in: 141ms listening on port 7676

INFO: Grizzly Framework 1.9.18-o started in: 172ms listening on port 8181

INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate

INFO: SEC1002: Security Manager is OFF.

INFO: Security startup service called

INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.

INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.

INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.

INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.

INFO: Security service(s) started successfully

INFO: Created HTTP listener http-listener-1 on port 8080

INFO: Created HTTP listener http-listener-2 on port 8181

INFO: Created HTTP listener admin-listener on port 4848

INFO: Created virtual server server

INFO: Created virtual server __asadmin

INFO: Virtual server server loaded system default web module

INFO: Inicializando Mojarra 2.0.2 (FCS b10) para o contexto '/fastfoodapp’

INFO: Loading application fastfoodapp at /fastfoodapp

INFO: Loading fastfoodapp Application done is 7785 ms

INFO: Inicializando Mojarra 2.0.2 (FCS b10) para o contexto '/teste’

INFO: Loading application teste at /teste

INFO: Loading teste Application done is 1450 ms

INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(2667ms) startup services(10249ms) total(12916ms)

INFO: Binding RMI port to *:8686

INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2

INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://Lap-Seven:8686/jndi/rmi://Lap-Seven:8686/jmxrmi

INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started

INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = C:\Program Files (x86)\glassfish-3.0.1\glassfish\modules\autostart, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = C:\Users\Lucas\AppData\Local\Temp\fileinstall-4638115119331237597, felix.fileinstall.filter = null}

INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = C:\Users\Lucas.netbeans\6.9\config\GF3\domain1\autodeploy\bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = C:\Users\Lucas\AppData\Local\Temp\fileinstall-1751345225840482239, felix.fileinstall.filter = null}

INFO: Created HTTP listener http-listener-1 on port 8080

INFO: Grizzly Framework 1.9.18-o started in: 0ms listening on port 8080

INFO: Perform lazy SSL initialization for the listener 'http-listener-2’

INFO: Created HTTP listener http-listener-2 on port 8181

INFO: Grizzly Framework 1.9.18-o started in: 0ms listening on port 8181

INFO: Updating configuration from org.apache.felix.fileinstall-autodeploy-bundles.cfg

INFO: Installed C:\Program Files (x86)\glassfish-3.0.1\glassfish\modules\autostart\org.apache.felix.fileinstall-autodeploy-bundles.cfg

INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = C:\Users\Lucas.netbeans\6.9\config\GF3\domain1\autodeploy\bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = C:\Users\Lucas\AppData\Local\Temp\fileinstall-6118387235412477970, felix.fileinstall.filter = null}
Z

estranho, meus componentes tambem não aparecem quando executo o projeto…

Só os primefaces… eu uso MOZILLA…

Alguem sabe o que pode ser ?

Obrigado!

L

Cara no meu caso era um problema com o padrão de url no web.xml
QUando eu criava o projeto no netBeans o padrão de url era mais ou menos assim “/faces/"
Se você executar o projeto apertando F6 a url que abre é mais ou menos assim “http://localhost:8084/nomedoProjeto/faces/paginaPrincipal.xhtml” nesse caso os componentes são renderizados normalmente por que o padrão "/faces/
” está sendo utilizado
Se você executar o projeto apertando Shift + F6 pra executar uma determinada página que não é a principal a url que abre é mais ou menos assim “http://localhost:8084/nomedoProjeto/outraPagina.xhtml” o endereço aparece sem o faces

Se o teu problema for o mesmo do meu tu pode colocar o faces no endereço sempre que tu for executar
Ou muda o padrão de url, tira o “/faces/" e por alguma ciosa tipo ".xhtml”

Z

llucas o meu esta normal…

http://localhost:8043/faces/index.xhtml

Não aparece nada ! ;/

Complicado… não sei mais o que fazer.

Z

Pessoal, fiz um projeto novo e consegui progredir !

Vejam o bem bolado..

O web.xml ficou assim :

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    <context-param>
        <param-name>primefaces.skin</param-name>
        <param-value>none</param-value>
    </context-param>
</web-app>

O index.html ficou assim

<meta http-equiv="REFRESH" content="0;url=teste.jsf">

Ai tem o arquivo "teste.xhtml" ( que no caso esta sendo reconhecido por teste.jsf )

<?xml version='1.0' encoding='UTF-8' ?>
<!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:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <p:editor />
        Hello from Facelets
    </h:body>
</html>

Ai funciona !

Mas se eu alterar o
<meta http-equiv="REFRESH" content="0;url=teste.jsf">
para
<meta http-equiv="REFRESH" content="0;url=teste.xhtml">
ele nao funciona... alguem sabe o porque ? Sendo que a extensão do arquivo é xhtml ..

Tem alguma coisa que eu possa fazer para melhorar ou vai assim msm ? =)

Abraço

Att

Criado 18 de outubro de 2010
Ultima resposta 12 de abr. de 2011
Respostas 7
Participantes 4