Jboss + EJB + Primefaces 3 + Jsf2 - Alguém já criou um projeto com essas configurações?

25 respostas
elugo

Boa noite Galera!
Estou iniciando a configuração de um projeto utilizando o servidor Jboss 6 + EJB 3 + primefaces 3.4 e jsf 2.
Estou tendo um problema na hora de acessar qualquer página que utiliza os componente do primefaces! quando tento acessar a página, simplemente fica em branco!

Se alguém já passou por isto e puder ajudar, agradeço!

segue configurações no web.xml

<context-param>
	<param-name>primefaces.skin</param-name>
        <param-value>afternoon</param-value>
</context-param>

pom.xml

<dependency>
			<groupId>org.primefaces</groupId>
			<artifactId>primefaces</artifactId>
			<version>3.4</version>
		</dependency>
		<dependency>
			<groupId>org.primefaces.themes</groupId>
			<artifactId>afternoon</artifactId>
			<version>1.0.5</version>
		</dependency>

		<!--extensao primefaces-->
		<dependency>
			<groupId>org.primefaces.extensions</groupId>
			<artifactId>primefaces-extensions</artifactId>
			<version>0.5.1</version>
		</dependency>

25 Respostas

tmvolpato

como você está acessando?

passe ai

vc só tem isso no web.xml?

essa configuraçao que vc tem é apenas para o theme do prime

elugo

Opa! eae blz!?
Então… estou acessando minhas páginas com a extesão .jsf (http://localhost:8080/uzze/teste.jsf) mas ai a página vem branco!

segue o web.xml completo.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>uzze</display-name>

	<welcome-file-list>
		<welcome-file>login.xhtml</welcome-file>
	</welcome-file-list>

	<servlet>
	    <servlet-name>Faces Servlet</servlet-name>
	    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
	</servlet>
	
	<servlet-mapping>
	    <servlet-name>Faces Servlet</servlet-name>
	    <url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

	<context-param>
		<param-name>javax.faces.PROJECT_STAGE</param-name>
		<param-value>Development</param-value>
	</context-param>

	<context-param>
		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
		<param-value>.xhtml</param-value>
	</context-param>

	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>

	<context-param>
		<param-name>primefaces.skin</param-name>
		<param-value>afternoon</param-value>
	</context-param>

	<context-param>
		<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
		<param-value>true</param-value>
	</context-param>

	<session-config>
		<session-timeout>15</session-timeout>
	</session-config>

	<listener>
		<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
	</listener>

	<listener>
		<listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
	</listener>

</web-app>
Hebert_Coelho

Aplicação Web Completa JSF EJB JPA JAAS

Aqui tem uma aplicação quase que igual feita e pronta para download.

tmvolpato

cade o conteudo da pagina que vc esta chamando

passe ai tbm

aprendizweb

!!

elugo
<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">

    <h:head>
        <title>Login</title>
        <link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/estilo.css"/>
    </h:head>
    <h:body>
        <f:view>
            <p:layout fullPage="true">
                <p:layoutUnit position="north" size="200" header="Login de acesso ao sistema" resizable="false" closable="false" collapsible="false">
                    <h:form style="text-align: center;">
                        <p:graphicImage value="/images/uzzelogo.png" width="300" height="160"/>
                    </h:form>
                </p:layoutUnit>

                <p:layoutUnit position="center">
                    <p:panel style="width: 400px; margin: 0% 0% 0% 35%;">
                        <h:form id="loginForm">
                            <p:messages id="mgs"/>
                            <h:panelGrid columns="1" cellpadding="2" style="margin:50px 0px 0px 40%" id="panel">
                                <h:panelGrid columns="1">
                                    <h:outputText value="Usuario"/>
                                    <p:inputText required="true" size="30" requiredMessage="Informe seu nome de usuário." id="usuario">
                                        <p:focus/>
                                    </p:inputText>
                                </h:panelGrid>
                                <h:panelGrid columns="1">
                                    <h:outputText value="Senha"/>
                                    <p:password feedback="false" size="30" id="senha" required="true" requiredMessage="Informe sua senha."/>
                                    <p:commandButton value="Entrar" update="panel,mgs" action="#" 
                                                     onclick="statusDialog.show();" onsuccess="statusDialog.hide();" ajax="false" style="float: right;" />
                                </h:panelGrid>
                            </h:panelGrid>
                        </h:form>
                        <h:form>
                            <p:commandButton value="template" action="/inicio.jsf"/>
                        </h:form>
                    </p:panel>
                    <p:dialog modal="true" widgetVar="statusDialog" header="Aguarde..."   
                              draggable="false" closable="false" resizable="false">  
                        <p:graphicImage value="/images/ajaxloadingbar.gif" />  
                    </p:dialog>
                </p:layoutUnit>
            </p:layout>
        </f:view>
    </h:body>
</html>
elugo

Umas das possiveis soluções que encontrei, foi trocar essa parte

<servlet-mapping>  
        <servlet-name>Faces Servlet</servlet-name>  
        <url-pattern>*.jsf</url-pattern>  
    </servlet-mapping>  

para 


<servlet-mapping>  
        <servlet-name>Faces Servlet</servlet-name>  
        <url-pattern>*.xhtml</url-pattern>  
    </servlet-mapping>

mas não obtive resultado.

tmvolpato

@elugo

faz o seguinte
faça um teste simples

apenas mande renderizar um componente simples do prime mesmo

se aparece o problema eh outro

<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">  
  
    <h:head>  </h:head> 

<h:body>

<p:editor />
</h:body>
</html>

ve se funciona

elugo

Não deu!!

Mandei exibir o código fonte:

<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">    
    
    <h:head>  </h:head>   
  
<h:body>  
  
<p:editor />  
</h:body>  
</html>
tmvolpato
elugo:
Não deu!!

Mandei exibir o código fonte:

<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">    
    
    <h:head>  </h:head>   
  
<h:body>  
  
<p:editor />  
</h:body>  
</html>

teste com esse

<!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"
      xmlns:p="http://primefaces.org/ui">

coloque o resto aqui...
tmvolpato

se não der certo poste a saida do log aqui

elugo

Mesma coisa!!!
E quanto ao log… não da erro! esse é o pior de tudo!

aprendizweb
Tenta isso:
<?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:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
<h:head>
        <title>Teste</title>
    </h:head>
<h:body>
Página de Teste !!!!
</h:body>
</html>
tmvolpato

mas se vc chama com .xhtml vai?

elugo

Sem utilizar os componentes do prime funciona!

elugo

Galera!

Coloquei o seguinte:

<!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"  
      xmlns:p="http://primefaces.org/ui">    
    
    <h:head>  </h:head>   
  
<h:body>  
	teste  
	<p:editor />
</h:body>  
</html>

ta imprimindo o teste!! deveria mostrar esse componente editor ai?

tmvolpato

elugo:
Galera!

Coloquei o seguinte:

<!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"  
      xmlns:p="http://primefaces.org/ui">    
    
    <h:head>  </h:head>   
  
<h:body>  
	teste  
	<p:editor />
</h:body>  
</html>

ta imprimindo o teste!! deveria mostrar esse componente editor ai?

é para mostrar isso

http://www.primefaces.org/showcase/ui/editor.jsf

aprendizweb

vc colocou o afternoon.jar do tema na pasta lib?

elugo

Sim! o jar esta la! configurei o processo de build pelo maven!

aprendizweb

bom no meu a configuração do Prime esta assim testa lá:

<context-param> <param-name>primefaces.THEME</param-name> <param-value>nomedotema</param-value> </context-param>

ou assim via maven

<dependency> <groupId>org.primefaces.themes</groupId> <artifactId>cupertino</artifactId> <version>1.0.8</version> </dependency>

elugo

Vou tentar!

elugo

Nada! :frowning:

aprendizweb

Faz o seguinte, se puder posta seu projeto pra download, pelo jeito só analisando ele como todo, eu utilizo Jboss + Hibernate + Primefaces 3 + Jsf2. Valeu!!!

elugo

Desculpe a demora! enviei la no seu email! vlw

elugo

Umas das coisas que observei agora… é que não está convertendo as tags do prime para html!
Quando mando exibir a página, exibe o fonte com as tags do prime. exp:. <p:editor>

Criado 13 de setembro de 2012
Ultima resposta 17 de set. de 2012
Respostas 25
Participantes 4