<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<!-- 自动扫描包名,扫描指定的包中的类上的注解 -->
<context:component-scan base-package="cn.ct.em.*.controller, cn.ct.em.v3.*.controller" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />

<!-- </context:component-scan>不仅可以完成 <context:annotation-config>一样的工作。

(<context:annotation-config>有助于完善Spring配置中的<Property>和<constructor-arg>元素,但是<bean>仍需显示定义 )

</context:component-scan>而且会自动扫描指定的包(cn.ct.em.*.controller, cn.ct.em.v3.*.controller)并查找出能够自动注册为Spring Bean的类

-->

</context:component-scan>

<!-- sping mvc 为@Controllers分发请求所必须的,并提供了数据绑定支持,读写XML支持,读写JSON的支持

  可以替换成<mvc:annotation-driven />自动的会自动注册DefaultAnnotationHandlerMapping与AnnotationMethodHandlerAdapter 两个bean  

  并提供了:数据绑定支持,@NumberFormatannotation支持,@DateTimeFormat支持,@Valid支持,读写XML的支持(JAXB),读写JSON的支持(Jackson)

-->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" />
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" />

<!-- 对静态资源文件的访问使用默认的servlet来响应

  

Tomcat, Jetty, JBoss, and GlassFish 自带的默认Servlet的名字 -- "default"
  Google App Engine 自带的 默认Servlet的名字 -- "_ah_default"
  Resin 自带的 默认Servlet的名字 -- "resin-file"
  WebLogic 自带的 默认Servlet的名字 -- "FileServlet"
  WebSphere 自带的 默认Servlet的名字 -- "SimpleFileServlet"

-->
<mvc:default-servlet-handler />
<!-- 视图解释类 -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/page/"></property>
<property name="suffix" value=".jsp"></property>
</bean>

</beans>

spring mvc 配置文件信息记录的更多相关文章

  1. Spring MVC 配置文件dispatcher-servlet.xml 文件详解

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  2. Spring MVC 配置文件dispatcher-servlet.xml 文件详解(转自 学无止境-yj)

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  3. Spring MVC配置文件的三个常用配置详解

    转自:http://www.cnblogs.com/benwu/articles/5162614.html Spring MVC项目中通常会有二个配置文件,sprng-servlet.xml和appl ...

  4. spring mvc 配置文件拦截器过滤url

    最近在用spring mvc拦截器,sprin 版本号4.0.6.RELEASE, <mvc:interceptor> <mvc:mapping path="/admin/ ...

  5. spring配置文件和spring mvc配置文件的区别

    Question: Are applicationContext.xml and spring-servlet.xml related anyhow in Spring Framework? Will ...

  6. spring mvc开发过程知识点记录

    给一个客户做的一个小项目,需求就是输入类似一个短网址http://dd.yy/xxxx然后跳转到另外一个域名下的图书文件.(实际很多短网址站都提供API供调用吧,不过客户需求是他自己建立一个短网址服务 ...

  7. mybatis整合spring获取配置文件信息出错

    描述:mybatis整合spring加载jdbc.properties文件,然后使用里面配置的值来 配置数据源,后来发现用户变成了admin- jdbc.properties的配置: 加载配置: 报错 ...

  8. Spring MVC 配置文件

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...

  9. Spring MVC配置文件

    都说开发Spring Web程序的配置文件很繁琐,所以就写了一篇配置博客, 首先是pom.xml文件 <project xmlns="http://maven.apache.org/P ...

随机推荐

  1. List<T>线性查找和二分查找BinarySearch效率分析

    今天因为要用到List的查找功能,所以写了一段测试代码,测试线性查找和二分查找的性能差距,以决定选择哪种查找方式. 线性查找:Contains,Find,IndexOf都是线性查找. 二分查找:Bin ...

  2. LeetCode Potential Thought Pitfalls

    Problem Reason Reference Moving ZeroesSort Colors Corner cases   Shortest Word Distance Thought: 2 p ...

  3. 5分钟实现VS2010整合NUnit进行单元测试

    本文转载自:http://www.cnblogs.com/jeffwongishandsome/archive/2012/03/18/2404845.html 1.下载安装NUnit(最新win版本为 ...

  4. ZooKeeper程序员指南(转)

    译自http://zookeeper.apache.org/doc/trunk/zookeeperProgrammers.html 1 简介 本文是为想要创建使用ZooKeeper协调服务优势的分布式 ...

  5. Bootstrap整体架构

    大多数Bootstrap的使用者都认为Bootstrap只是提供了CSS组件和JavaScript插件,其实CSS组件和JavaScript插件只是Bootstrap框架的表现形式而已,他们都是构建在 ...

  6. 切服务器时请注意robots.txt文件

    最近两天切服务器时又出现测试机器忘记改robots.txt文件的情况,以后就用个二级域名做测试,测试的机器也不对robots.txt作限制.

  7. Linux修改/etc/profile不生效的问题

    今天在原来的机器上修改了JDK的路径配置,但死活不生效. 后来查了~/.bash_profile文件,里面没有配置. 最后查~/.bashrc文件,发现里面有JDK的配置

  8. java readLine()

    原文 虽然写IO方面的程序不多,但BufferedReader/BufferedInputStream倒是用过好几次的,原因是: 它有一个很特别的方法:readLine(),使用起来特别方便,每次读回 ...

  9. oracle11g rac修改归档

    oracle11g归档日志可以放在本地.共享存储或ASM磁盘,本次修改放在本地盘中 1.创建归档所需要的路径 节点1: mkdir /arch1 chown -R oracle:oinstall /a ...

  10. (整理)SQL server 2012 中文乱码与5030错误

    安装2012后,一直没注意到中文的问题.直到有一天,突然发现字段内容竟然是“??”,然后一通查,原来是排序规则需要改变: 选择数据库->右键属性->选项,将排序规则改成“Chinese_P ...