zoukankan      html  css  js  c++  java
  • springmvc-config.xml模板

    <?xml version="1.0" encoding="UTF-8"?>
    <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/mvc
                            http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
                            http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                            http://www.springframework.org/schema/context
                              http://www.springframework.org/schema/context/spring-context-4.0.xsd">
        
        <!-- 1.配置前端控制器放行静态资源(html/css/js等,否则静态资源将无法访问) -->
        <mvc:default-servlet-handler/>
        
        <!-- 2.配置注解驱动,用于识别注解(比如@Controller) -->
        <mvc:annotation-driven></mvc:annotation-driven>
        
        <!-- 3.配置需要扫描的包:spring自动去扫描 base-package 下的类,
            如果扫描到的类上有 @Controller、@Service、@Component等注解,
            将会自动将类注册为bean 
         -->
        <context:component-scan base-package="com.tsvv.controller">
        </context:component-scan>
        
        <!-- 4.配置内部资源视图解析器
            prefix:配置路径前缀
            suffix:配置文件后缀
         -->
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/pages/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
        
        
    </beans>
  • 相关阅读:
    冬至——汤圆
    偷偷的高兴!
    sql 70229 考试样题(2)
    SQL Server开发人员应聘常被问的问题妙解汇总
    GOOLE Picasa Web License
    辞旧迎新!
    VC98\mfc\lib' specified in 'LIB environment variable' 系统找不到指定路径
    ASP 入门
    OpenCV类型转换
    坐标旋转变换公式的推导
  • 原文地址:https://www.cnblogs.com/tsvv-plus/p/11911069.html
Copyright © 2011-2022 走看看