Ajuda jsf 1.2 e richfaces

4 respostas
I

Boa tarde!

Estou começando a estudar Spring. Criei um projeto exemplo e depois de muitos erros de jars resolvidos, conseguir fazer subir uma pagina. O problema é que não aparece absolutamente nehum componente, aparece a pagina completamente em branco. Estou usando jsf 1.2 e richfaces.

A pagina abaixo não aparece nada:
<ui:composition 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:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
    
    <f:view>
    <h:form>
    	<rich:panel header="Olá RichFaces" style="width: 300px" id="teste">
			<h:outputText value="Seu nome: " />
			<a4j:commandButton value="Dizer oláaaa"
			reRender="olaPainel"/>
			<h:panelGroup id="olaPainel" layout="block">
			</h:panelGroup>
		</rich:panel>
	</h:form>
    </f:view>
    
    
</ui:composition>

pedaço do pom.xml

<?xml version="1.0" encoding="UTF-8" ?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">	
	
		<dependency>
			<groupId>org.richfaces.ui</groupId>
			<artifactId>richfaces-ui</artifactId>
			<version>3.3.2.SR1</version>
		</dependency>	
	
</project>

pedaço do web.xml

<filter-mapping>
	<filter-name>richfaces</filter-name>
	<servlet-name>Faces Servlet</servlet-name>
	<dispatcher>REQUEST</dispatcher>
	<dispatcher>FORWARD</dispatcher>
	<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

Alguém sabe o que esta errado?

Desde já agradeço!

Izaura

4 Respostas

Hebert_Coelho

Qual url você está chamando?

Como você está mapeando no web.xml?

I

Olá jakefrog!

jakefrog:
Qual url você está chamando? http://localhost:8080/exemploSpring/teste.xhtml

Como você está mapeando no web.xml?

web.xml

<?xml version="1.0"?>
<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">

	<description>Casual Class Spring Exemplo</description>

	<display-name>Exemplo Casual Class Spring</display-name>

	<!-- Define os arquivos de configuracoes XML para o contexto Spring -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			/WEB-INF/spring-config.xml,classpath*:br/com/globalcode/cc/**/spring-config.xml
		</param-value>
	</context-param>

	<!-- Inicializa o Spring Web Application Context -->
	<listener>
		<listener-class>
			org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>

	<!-- Ativa os escopos web para os beans no Spring -->
	<listener>
		<listener-class>
			org.springframework.web.context.request.RequestContextListener
		</listener-class>
	</listener>

	<!-- Define o skin para o Richfaces -->
	<context-param>
		<param-name>org.richfaces.SKIN</param-name>
		<param-value>blueSky</param-value>
	</context-param>

	<!-- Configura integracao do Richfaces com Facelets -->
	<context-param>
		<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
		<param-value>com.sun.facelets.FaceletViewHandler</param-value>
	</context-param>

	<context-param>
		<param-name>facelets.REFRESH_PERIOD</param-name>
		<param-value>2</param-value>
	</context-param>

	<context-param>
		<param-name>facelets.DEVELOPMENT</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>facelets.SKIP_COMMENTS</param-name>
		<param-value>true</param-value>
	</context-param>

	<!-- Extensao dos arquivos de definicao de tela JSF -->
	<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>com.sun.faces.validateXml</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>com.sun.faces.verifyObjects</param-name>
		<param-value>false</param-value>
	</context-param>

	<filter>
		<display-name>RichFaces Filter</display-name>
		<filter-name>richfaces</filter-name>
		<filter-class>org.ajax4jsf.Filter</filter-class>
	</filter>

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

	<filter-mapping>
		<filter-name>richfaces</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<login-config>
		<auth-method>BASIC</auth-method>
	</login-config>

</web-app>
Hebert_Coelho

Pois é, você está chamando por http://localhost:8080/exemploSpring/teste.xhtml
mas você mapeou com <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> Tente http://localhost:8080/exemploSpring/teste.jsf

I

Obrigada jakefrog!

Então, aparece a seguinte mensagem de erro colocando o .jsf

Deu o seguinte erro:

Mar 23, 2012 4:37:52 PM org.apache.catalina.core.StandardWrapperValve invoke Grave: Servlet.service() for servlet [Faces Servlet] in context with path [/exemploSpring] threw exception [Tentativa ilegal de definir ViewHandler depois de uma resposta ter sido renderizada.] with root cause java.lang.IllegalStateException: Tentativa ilegal de definir ViewHandler depois de uma resposta ter sido renderizada. at com.sun.faces.application.ApplicationImpl.setViewHandler(ApplicationImpl.java:562) at org.ajax4jsf.event.InitPhaseListener.beforePhase(InitPhaseListener.java:92) at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:113) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

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