Estou tendo serios problemas com Spring MVC
inseri o metodo messagesource no AppWebconfiguration e simplismente não funciona a validação dos parametros...dá http 500
Segue erro...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messagesource'
segue codigo..
package br.roupasintimas.loja.conf;
import org.springframework.context.MessageSource;
//import org.hibernate.annotations.Filter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
//import org.springframework.web.servlet.config.annotation.EnableWebMvc;
//import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import br.roupasintimas.loja.controllers.HomeController;
import br.roupasintimas.loja.daos.ProdutoDAO;
//@EnableWebMvc //digo pro spring que vou usar a parte mvc dele
@Configuration
@ComponentScan(basePackageClasses={HomeController.class, ProdutoDAO.class}) //digo pro Spring varrer esses pacotes
public class AppWebConfiguration {
//Aqui vamos mapear onde está a view
@Bean //Classe gerenciado pelo spring
public InternalResourceViewResolver internalResourceViewResolver(){
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix(".jsp"); //Pra não ficar digitando no controler
return resolver;
}
@Bean
public MessageSource messagesource(){
ReloadableResourceBundleMessageSource messagesource = new ReloadableResourceBundleMessageSource();
messagesource.setBasename("/WEB-INF/message");
messagesource.setDefaultEncoding("UTF-8");
messagesource.setCacheSeconds(1);
return messagesource();
}
}
Alguem poderia dar uma força?