spring_reference/IV. Spring Boot features/26.1.3. MessageCodesResolve...

4 lines
384 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 26.1.3. MessageCodesResolver
Spring MVC有一个策略用于从绑定的errors产生用来渲染错误信息的错误码MessageCodesResolver。如果设置`spring.mvc.message-codes-resolver.format`属性为`PREFIX_ERROR_CODE`或`POSTFIX_ERROR_CODE`(具体查看`DefaultMessageCodesResolver.Format`枚举值Spring Boot会为你创建一个MessageCodesResolver。