zoukankan      html  css  js  c++  java
  • SpringMvc.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:p="http://www.springframework.org/schema/p"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                http://www.springframework.org/schema/context 
                http://www.springframework.org/schema/context/spring-context-3.2.xsd
                http://www.springframework.org/schema/aop 
                http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
                http://www.springframework.org/schema/tx 
                http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
                http://www.springframework.org/schema/mvc 
                http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
                
        <!--使Spring支持自动检测组件,如注解的Controller-->
        <!-- <context:component-scan base-package="com.minx.crm.web.controller"/>
        <bean id="viewResolver"
              class="org.springframework.web.servlet.view.InternalResourceViewResolver"
              p:prefix="/WEB-INF/jsp/"
              p:suffix=".jsp" /> -->
        <!-- 处理器 -->
        <bean name="/queryItems1.action" class="com.mybatis.controller.ItemsController1"></bean>
        <!-- 注解的处理器可以单个配置  但是我们可以使用spring框架的组件扫描的方式来配置
        base-package:需要扫描哪个包下面的处理器
         -->     
        <context:component-scan base-package="com.mybatis.controller"></context:component-scan>
        <!-- 处理器映射器 -->
        <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
        <!-- 注解的处理器映射器 -->
        <!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"></bean> -->
        <!-- 处理器适配器 -->
        <!-- 所有的适配器都实现HandlerAdapter接口 -->
        <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>
        <!--  注解的处理器适配器 -->
        <!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"></bean> -->
        <!-- 可代替上面注解的处理器和处理器适配器的配置 建议使用 -->
        <mvc:annotation-driven></mvc:annotation-driven>
        <!-- 视图解析器 -->
        <!-- 解析jsp 默认使用jstl标签 classpath下得有jstl包 -->
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <!-- 配置jsp路径的前缀 -->
            <property name="prefix" value="/WEB-INF/jsp/"></property>
            <property name="suffix" value=".jsp"></property>
        </bean>
    </beans>
  • 相关阅读:
    50种方法巧妙优化你的SQL Server数据库
    sql server数据库中选出指定范围的行的sql语句写法
    如何开启SQLSERVER数据库缓存依赖优化网站性能
    网站项目建设流程概述
    一个flash网页图片播放器
    ASP.NET中备份sqlserver数据库的方法
    ASP.NET(C#)实现一次性上传多张图片(多个文件)
    GridView使用技巧之:新增记录、GridView内数据验证、删除信息提示等
    FreeTextBox控件上传图片到指定的绝对路径的改进
    Linux环境下的32位与64位
  • 原文地址:https://www.cnblogs.com/mrluotong/p/5898469.html
Copyright © 2011-2022 走看看