此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Framework 6.2.0! |
MVC 配置 API
在 Java 配置中,您可以实现WebMvcConfigurer
接口,作为
以下示例显示:
-
Java
-
Kotlin
@Configuration
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {
// Implement configuration methods...
}
@Configuration
@EnableWebMvc
class WebConfig : WebMvcConfigurer {
// Implement configuration methods...
}
在 XML 中,您可以检查<mvc:annotation-driven/>
.您可以
查看 Spring MVC XML 模式或使用
IDE 的代码补全功能,用于发现哪些属性和
子元素可用。