# 默认配置的定制化

在MVC Java编程配置方式下，如果你想对默认配置进行定制，你可以自己实现`WebMvcConfigurer`接口，要么继承`WebMvcConfigurerAdapter`类并覆写你需要定制的方法：

```java
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {

    // Override configuration methods...

}
```

在MVC XML命名空间下，如果你想对默认配置进行定制，请查看`<mvc:annotation-driven/>`元素支持的属性和子元素。你可以查看[Spring MVC XML schema](http://schema.spring.io/mvc/spring-mvc.xsd)，或使用IDE的自动补全功能来查看有哪些属性和子元素是可以配置的。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ethan-lin.gitbook.io/spring-mvc-documentation-linesh-translation/part-ii-wen-dang-nei-rong-documentation-contents/configuring-spring-mvc/2-customizing-the-provided-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
