MVC 配置 API
在Java配置中,你可以实现WebMvcConfigurer接口,如下例所示:
- Java
- Kotlin
@Configuration
public class WebConfiguration implements WebMvcConfigurer {
// Implement configuration methods...
}
@Configuration
class WebConfiguration : WebMvcConfigurer {
// Implement configuration methods...
}
在XML中,你可以检查<mvc:annotation-driven/>的属性和子元素。你可以查看Spring MVC XML模式,或者使用你的IDE的代码补全功能来发现有哪些属性和子元素是可用的。