Jsf + spring

0 respostas
anderson.bonavides

Pessoal, to com uma duvida em relação ao Spring Framework adicionado ao Java Server Faces.

Tenho um o arquivo xml

[size=16]applicationContext.xml[/size]

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
	default-autowire="byName">

	<aop:aspectj-autoproxy />
	

	
	<bean id="usuario" class="br.com.projetobase.bean.UsuarioBean"
		scope="session">
		<property name="usuario" ref="usuario" />
	</bean>

</beans>

[size=16]O faces-config.xml:[/size]

<?xml version="1.0"?>
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xi="http://www.w3.org/2001/XInclude"
	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-facesconfig_1_2.xsd">


	<application>
		<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
		<el-resolver>
			org.springframework.web.jsf.el.SpringBeanFacesELResolver
		</el-resolver>
	</application>
</faces-config>

[size=16]O web.xml: [/size]

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
	version="2.4">

	<display-name>ProjetoBase</display-name>

	<!-- #################### CONFIGURAÇÃO DO SPRING #################### -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/applicationContext.xml</param-value>
	</context-param>

	<listener>
		<listener-class>
			org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>
	
	<listener>
		<listener-class>
			org.springframework.web.context.request.RequestContextListener
		</listener-class>
	</listener>


</web-app>

[size=16]E o seguinte Managed Bean:[/size]

public class UsuarioBean {
	
	private String nome;
	private String telefone;
	private Integer idade;
	private Date dataNascimento;
	
	private String rua;
	private Integer numero;
	private String cpf;
	private String bairro;
	private String cidade;
	private String pais;
	
	private String nomeLogin;
	private String senha;
	
	private Usuario usuario;
	private Endereco endereco;
	private Login login;
	
	public UsuarioBean(){
		
	}
	
	//GETR´S E SETER´S

	public String cadastrar(){
		System.out.println("#### SUCESSO DO SPRING ####");
		return "Sucesso";
	}
	
}

O resultao é que não consigo eibi a mensagem de sucesso do Managed Bean. Alguem poderia dar uma dica/

Grato!

Criado 17 de fevereiro de 2009
Respostas 0
Participantes 1