Skip to content

Instantly share code, notes, and snippets.

@gdonega
Last active March 12, 2020 00:02
Show Gist options
  • Save gdonega/136dd899920a798c5e84361946c4b53c to your computer and use it in GitHub Desktop.
Save gdonega/136dd899920a798c5e84361946c4b53c to your computer and use it in GitHub Desktop.
package com.testes.spring.maven.simples.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration // Faz o Spring mapear essa classe
@ComponentScan("com.testes.spring.maven.simples") // Indica onde o Spring deve procurar novos componentes
@EnableWebMvc // Ativa o suporte básico do Spring para uma aplicação MVC. Ele, por exemplo,
// mapeia os controllers, ativa o suporte de validação, os handlers de
// exception, entre outras coisas...
public class WebConfig implements WebMvcConfigurer // Essa implementação permite que nós alteremos qualquer configuração
// do @EnableWebMvc nessa classe (de uma olhada nas sobreescritas
// possíveis)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment