Erro na renderização de página JSP 2.0.4 com PrimeFaces 2.2

4 respostas
G

Boa tarde a todos, estou iniciando um projeto utilizando jsf 2.0 com primefaces 2.2.1 e estou tendo o seguinte problema:
Criei uma página jsp simples até então com um menu e um submenu somente, para testar o designe que peguei das skins do primefaces, porem após eu levantar meu servidor tomcat e ir no browse chamar meu aplicativo, a página não apresenta nada no resultado. O que pode ser isto? Detalhe que nenhum erro é apresentado no console.

Segue os códigos: web.xml
<?xml version="1.0" encoding="ASCII"?>
<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_3_0.xsd"
	version="3.0">
	<display-name>SPA</display-name>
	<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>

	<context-param>
		<param-name>primefaces.THEME</param-name>
		<param-value>le-frog</param-value>
	</context-param>

	<welcome-file-list>
		<welcome-file>/paginas/principal.xhtml</welcome-file>
	</welcome-file-list>

</web-app>
principal.xhtml
<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.prime.com.tr/ui">
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title>Sistema de Pedidos Agrícolas</title>
	</h:head>
	<h:body>
		<p:layout fullPage="true">
			<!-- topo da página -->
			<p:layoutUnit position="top" height="95" header="CALFERIL - SPA">
				<h:form prependId="false">
					<!-- menu principal -->
					<p:menubar id="menuPrincipal" autoSubmenuDisplay="true">
						<p:submenu id="submenuCliente" label="Cliente" icon="">
							<p:menuitem value="Cadastrar" url="/paginas/cliente.jsp"/>					
						</p:submenu>
					</p:menubar>
					<!-- /menu principal -->
				</h:form>
			</p:layoutUnit>
			<!-- /topo da página -->
		</p:layout>
	</h:body>
</html>

imagem + firebug
[url]http://img141.imageshack.us/i/spa2.png/[/url]
Não sei se esta imagem ficou boa pra vcs mas foi pra demonstrar que o browse "encherga" o código mas ele fica como se estivesse hidden!
Alguem pode me ajudar? Desde já agradeço pelas respostas!

4 Respostas

G

alguem??

G

Mais alguem? Ajuda ai quem puder já estou a muito tempo procurando a solução e nada!

G

Detalhe: estou utilizando tomcat 7 e troquei a JSP por uma XHTML porém o erro persiste!

G

problema resolvido, o caso era configurações de web.xml, coloquei a seguinte pro caso de alguem ter o mesmo problema e precisar deste tópico:

<?xml version="1.0" encoding="ASCII"?>
<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_3_0.xsd"
	version="3.0">

	<display-name>SPA</display-name>

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

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

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

	<servlet>
		<servlet-name>Resource Servlet</servlet-name>
		<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>Resource Servlet</servlet-name>
		<url-pattern>/primefaces_resource/*</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>/paginas/principal.faces</welcome-file>
	</welcome-file-list>

	<context-param>
		<param-name>primefaces.THEME</param-name>
		<param-value>le-frog</param-value>
	</context-param>
</web-app>
Criado 26 de fevereiro de 2011
Ultima resposta 27 de fev. de 2011
Respostas 4
Participantes 1