Duvida com PrimeFaces

4 respostas
albertodvm

Ola pessaol,

Estou o seguinte código em Xhtml, com o framework Primefaces,
Executo o projeto prefeito sem errao, porém não aparece nada na pagina.

<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:p="http://primefaces.org/ui">
    <head>
        <title>Title</title>
    </head>
    <h:body>
        <h:panelGrid columns="1" cellpadding="5">
            <p:commandButton id="basic" value="Basic" onclick="dlg1.show();" type="button" />

            <p:commandButton id="modalDialogButton" value="Modal" onclick="dlg2.show();" type="button"/>

            <p:commandButton id="effectsDialogButton" value="Effects" onclick="dlg3.show();" type="button" />
        </h:panelGrid>

        <p:dialog id="basicDialog" header="Basic Dialog" widgetVar="dlg1">
            <h:outputText value="Resistance to PrimeFaces is futile!" />
        </p:dialog>

        <p:dialog id="modalDialog" header="Modal Dialog" widgetVar="dlg2" modal="true" height="100">
            <h:outputText value="This is a Modal Dialog." />
        </p:dialog>

        <p:dialog header="Effects" widgetVar="dlg3" showEffect="explode" hideEffect="bounce" height="100">
            <h:outputText value="This dialog has nice effects." />
        </p:dialog>
    </h:body>
</html>

Alguem sabe me dizer o que parece estar errado?

Att,

Alberto Paschoal

4 Respostas

mauricioadl

seu web.xml esta configurado certo? esta mapeando a servlet do jsf?

albertodvm

fala mauricioadl,

<web-app 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_3_0.xsd" version="3.0"> <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.xhtml</welcome-file> </welcome-file-list> <context-param> <param-name>primefaces.skin</param-name> <param-value>none</param-value> </context-param> </web-app>

Dessa maneira que esta e o primefaces-3.2.jar tbm esta na biblioteca.

mauricioadl

troque isso
<url-pattern>*.jsf</url-pattern>

por isso
<url-pattern>*.xhtml</url-pattern>

albertodvm

Vleww mauricioadl,

Muito obrigado.

Criado 22 de março de 2012
Ultima resposta 22 de mar. de 2012
Respostas 4
Participantes 2