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 的代码补全功能,用于发现哪些属性和
子元素可用。