Problemas com sistema web usando jsf + primefaces + css

7 respostas
F
Bom galera so novo aki, mais tem essa pagina xhtml que quando executo meu projeto não aparece o panelGrid, fica um espaço em branco, e so mostra o "Logar Sistema" como um texto normal, nada do panelGrid. Ja tenho todos os jar do primefaces no sistema. Se alguem poder me ajuda agradeço.
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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">
        <!--f:view-->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <h:head>
            <title>Login Coordenador/Aluno</title>
        </h:head>
        <h:body>
       
<link href="./ProLanding_files/style.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="Untitled-2.css" />
<link rel="stylesheet" type="text/css" href="Untitled-1.css" />
<style type="text/css">
<!--
#apDiv1 {
	position:absolute;
	width:132px;
	height:395px;
	z-index:1;
	left: 11px;
	top: 250px;
}
#apDiv2 {
	position:absolute;
	width:1049px;
	height:68px;
	z-index:2;
	left: 151px;
	top: 133px;
}
#apDiv3 {
	position:absolute;
	width:401px;
	height:41px;
	z-index:1;
	left: 323px;
	top: 217px;
}
#apDiv4 {
	position:absolute;
	width:136px;
	height:427px;
	z-index:1;
	left: 13px;
	top: 238px;
}
#apDiv5 {
	position:absolute;
	width:167px;
	height:62px;
	z-index:6;
	left: 52px;
	top: 587px;
}
#apDiv6 {
	position:absolute;
	width:172px;
	height:76px;
	z-index:7;
	left: 51px;
	top: 672px;
}
-->
</style>
        <!--/head-->
       
			<!-- start header -->
&lt;div id="navMenu"&gt; <ul>
  <li><a >Pagina Inicial</a>
  </li>

  </ul>

  <ul>
  <li><a >Login Aluno</a>
  </li>

  </ul>

  <ul>

  </ul>
 &lt;/div&gt;




&lt;div class="header"&gt;
  &lt;div class="cont"&gt;<a ><img    /></a><img    />
    <ul >
      <li>Sistema CEPEP</li>
      <li>O seu melhor jeito de solicitar projetos.</li>

    </ul>
    &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- end header --&gt;
&lt;!-- start newsletter --&gt;
&lt;div class="newsletter"&gt;
  &lt;div class="cont"&gt;
    &lt;!-- start form --&gt;
    &lt;form action="" class="newsletter_form"&gt;
    &lt;/form&gt;
    &lt;div class="clear"&gt;&lt;/div&gt;
    &lt;!-- end form --&gt;
  &lt;/div&gt;
&lt;/div&gt;
<p></p> <p></p>
            &lt;!--body background="Imagens/Fundo2.jpg"--&gt;
            &lt;f:view&gt;
            &lt;center&gt;
            &lt;h:form id="form"&gt;
                     &lt;h:panelGrid columns="2"&gt;
                        &lt;f:facet name="header"&gt;
                            Logar Sistema
                        &lt;/f:facet&gt;

                        &lt;h:outputLabel for="CPF" value="CPF: " /&gt;
                        &lt;p:inputText id="cpf" value="#{CoordenadorProfessorController.usuario.CPF}" size="50"  required="true" requiredMessage="Campo Obrigatório"/&gt;

                        &lt;h:outputLabel for="Senha" value="Senha: " /&gt;
                        &lt;p:password id="login" value="#{CoordenadorProfessorController.usuario.login}" size="50"  required="true" requiredMessage="Campo Obrigatório" /&gt;

                        &lt;f:facet name="footer"&gt;
                            &lt;p:commandButton type="button" value="Logar"  action="#{CoordenadorProfessorController.logar}" icon="ui-icon-check" style="margin:0"/&gt;
                            &lt;p:commandButton  type="button" value="Novo Usuario" action="CadastroCoordenadorProfessor.faces" icon="ui-icon-check" style="margin:0"/&gt;
                            &lt;p:commandButton type="button" value="Voltar"  action="welcomeJSF.faces" icon="ui-icon-check" style="margin:0"/&gt;

                        &lt;/f:facet&gt;
                    &lt;/h:panelGrid&gt;
            &lt;/h:form&gt;
            &lt;/center&gt;
                &lt;/f:view&gt;
      <br/>
                    <p></p>
                    

                &lt;!-- start footer --&gt;
          
&lt;div class="footer"&gt;
  &lt;div class="cont"&gt;
    <ul >
      <li >
        &lt;h3&gt;Duvidas&lt;/h3&gt;
        <ul>
          <li><a href="http://www.uniformg.edu.br" >Unifor-MG</a></li>

        </ul>
<p></p>
      </li>
      <li >
        &lt;h3&gt;Categorias&lt;/h3&gt;
        <ul>
          <li><a >Contato</a></li>
        </ul>
      </li>
      <li >
        &lt;h3&gt;Rede Social&lt;/h3&gt;
        <ul >
          <li><a href="http://www.facebook.com">Facebook</a></li>
          <li><a href="http://twitter.com">Twitter</a></li>



        </ul>
      </li>
    </ul>
    &lt;div class="clear"&gt;&lt;/div&gt;
    &lt;div class="hr2"&gt;&lt;/div&gt;
    <p>Todos direitos reservados.</p>
  &lt;/div&gt;
&lt;/div&gt;

&lt;!-- end footer --&gt;

      &lt;/h:body&gt;

&lt;!--    /f:view--&gt;
    &lt;/html&gt;

7 Respostas

JeffersonFelix

O h:panelGrid é do JSF, não do primefaces. Ele não deve estar renderizando nada de JSF, e por consequência, nenhum componente do primefaces.
Se estiver utilizando o tomcat, verifique se possui as bibliotecas do JSF, e o arquivo web.xml deve conter:

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

Se estiver utilizando JBoss ou Glassfish, daí já não sei o que pode ser, pois elas já estão incluídas no servidor de aplicações.

denis_gariglio

Fala Jefferson, cara … coloca seu panelGrid dentro de um panel, tipo

<p:panel header="Selecione o aluno">
     <h:panelGrid columns="2"> 
.
.
. 
</p:panel>
     </h:panelGrid>

[]s

F

O JeffersonFelix eu tenho a biblioteca do jsf no meu projeto já, e meu web.xml ja contém este servlet e estou usando o glassfish, por isso que ta dificil resolver o problema.

JeffersonFelix

Acredito que aí está o problema, deve estar acontecendo uma incompatibilidade de versões do JSF.
Retire as libs do jsf de seu classpath (jsf-impl e jsf-api) e utilize somente a versão que vem com o glassfish.
Dê um clean e compile o projeto novamente.
Deve resolver.

F

Ou nada viu cara, fiz isso que você falou e não resolveu o problema, não continua aparecendo o panelGrid na tela, ta dificil.

R

Tenta separar o teu CSS da tela principal de visualizacao, poe tudo centralizado.

Outra coisa, verifica se voce fechou certinho as tags, tem muito comentario ae, c pode ter se confundido.

R

Enfim organiza seu codigo, porque ta ate cansativo de ler, olha esse trecho:

<form action="" class="newsletter_form">  
</form>

Numa linha voce cria um form, na outra voce fecha, ou seja, nao ta servindo pra nada =D

Abraços.

Criado 14 de janeiro de 2013
Ultima resposta 15 de jan. de 2013
Respostas 7
Participantes 4