import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@Configuration
@ComponentScan({"controller","config"})
@EnableWebMvc
public class SpringMvcConfig {
}
本文展示了一个简单的 Spring MVC 配置类实例,通过使用 @Configuration、@ComponentScan 和 @EnableWebMvc 注解来启动 Spring MVC 的核心功能,并指定控制器和配置组件的扫描路径。
303

被折叠的 条评论
为什么被折叠?



