Spring框架SpringMVC-Config.xml模板


<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd     
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-4.2.xsd">

    
    <context:component-scan base-package="***.***.controller"/>
    
    <mvc:annotation-driven/>
    
    <mvc:default-servlet-handler/>

    
    <mvc:interceptors>
        <mvc:interceptor>
            
            <mvc:mapping path="/*"/>
              
            <bean class="***.***.***"/>
        mvc:interceptor>
    mvc:interceptors>


    
     <bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
        
        <property name="prefix">
            <value>/WEB-INF/jsp/value>
        property>
        
        <property name="suffix">
            <value>.jspvalue>
        property>
    bean>

     <bean id="multipartResolver"  
        class="org.springframework.web.multipart.commons.CommonsMultipartResolver">  
        
        <property name="maxUploadSize">  
            <value>********value>  
        property>  
        
        <property name="defaultEncoding">
            <value>UTF-8value>
        property>
    bean>

beans>

你可能感兴趣的:(JavaWeb)