in theThe default built-in WebapplicationcontextDispatcherservlet-dependent bean! We can make custom parameter settings for these beans based on the actual project needs. Because if our custom bean is present in the configuration file, then the default bean will be overwritten. The following is a detailed explanation of which beans are used by default in MVC. 1, handlermapping processing request mapping of the road strength2,handleradapter 3, Handlerexceptionresolver exception handling information, is the time you can customize the error message to which view to go<bean
class= " Org.springframework.web.servlet.handler.SimpleMappingExceptionResolver,
<property name= "exceptionmappings";
<props>
<!--no permissions-->
<prop key= " Org.apache.shiro.authz.UnauthorizedException ">ERROR</PROP>
<!--upload error-->
<prop
key = "Org.springframework.web.multipart.MaxUploadSizeExceededException" >ERROR_FILEUPLOAD</PROP>
</props>
</property>
Span style= "White-space:pre" > </bean> 4. Viewresolver View parser, customize the prefix and the suffix of the view file where you can configure the default view <bean
class= "Org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name= "prefix" value= "/" ></property>
<property name= "suffix" value= ". JSP" ></property>
</bean>
5. Localeresolver International Information View6, Themeresolver Theme Parser 7, Multipartresolver file Upload function, custom can use commons Io as a function of implementation<bean id= "Multipartresolver"
class= "Org.springframework.web.multipart.commons.CommonsMultipartResolver" >
<!--Specifies that the total size of the uploaded file cannot exceed 200KB. Note that the limit for the Maxuploadsize property is not for individual files, but for the sum of the capacity of all files.
<property name= "maxuploadsize" value= "200000"/>
</bean>
8, Flashmapmanager
What Spring Mvc--webapplicationcontext has done