首页 > 编程语言 > 详细

springmvc.xml标配配置

时间:2019-11-21 17:20:05      阅读:55      评论:0      收藏:0      [点我收藏+]

这里提供配置模板【绝不会多余】:

<context:component-scan base-package="com.atguigu"></context:component-scan>
    
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/"></property>
        <property name="suffix" value=".jsp"></property>
    </bean>

        
    
    <mvc:default-servlet-handler/>
    <mvc:annotation-driven ></mvc:annotation-driven>

 

以后一上来就按上述配置,可以避免很多bug运行报错

<context:component-scan base-package="com.atguigu"></context:component-scan>

    

     <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">

          <property name="prefix" value="/WEB-INF/pages/"></property>

          <property name="suffix" value=".jsp"></property>

     </bean>

 

         

    

     <mvc:default-servlet-handler/>

     <mvc:annotation-driven ></mvc:annotation-driven>

 

springmvc.xml标配配置

原文:https://www.cnblogs.com/yanl55555/p/11906805.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!