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:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.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.xsd">
        
        
    <!--通知spring使用cglib而不是jdk的来生成代理方法 AOP可以拦截到Controller

          <aop:aspectj-autoproxy proxy-target-class="true"/>

        --> 
           <!--自动扫描-->
           <context:component-scan base-package="com.jy.rs.controller" />
           <!--注解驱动-->
           <mvc:annotation-driven />
            <!-- 配置用户授权拦截器,判断该用户是否可以访问某个URL -->
            <mvc:interceptors>
                <mvc:interceptor>
                    <mvc:mapping path="/**"/>
                    <!-- 如果是用户登录,则不需要判断 -->        
                    <mvc:exclude-mapping path="/login"/>
                    <bean class="com.jy.rs.interceptor.UserInterceptor" />
                </mvc:interceptor>
            </mvc:interceptors>
           <!--映射静态资源-->
           <mvc:resources mapping="/js/**" location="/WEB-INF/js/"/>
           <mvc:resources mapping="/img/**" location="/WEB-INF/img/"/>
           <mvc:resources mapping="/easyui/**" location="/WEB-INF/easyui/"/>
           <mvc:resources mapping="/images/**" location="/WEB-INF/images/"/>
           <mvc:resources mapping="/json/**" location="/WEB-INF/json/"/>
           <mvc:resources mapping="/ueditor/**" location="/WEB-INF/ueditor/"/>
         <!--   <mvc:resources mapping="/css/**" location="/css/"/>
           <mvc:resources mapping="/easyui/**" location="/easyui/"/>
           <mvc:resources mapping="/My97DatePicker/**" location="/My97DatePicker/"/> -->
    
           <!--视图解析器-->
           <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
                  <property name="prefix" value="/WEB-INF/"/>
                  <property name="suffix" value=".jsp"/>
           </bean>
    <!-- 文件上传下载需要的jar包 : commons-io commons-fileupload.jar --> <!-- 文件上传解析器 --> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="maxUploadSize" value="1000000" /> </bean> <!--避免IE执行AJAX时,返回JSON出现下载文件 --> <!-- <bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>text/html;charset=UTF-8</value> </list> </property> </bean> --> </beans>
    人生没有彩排,每天都是现场直播!
  • 相关阅读:
    随手练——几个递归小题目
    随手练——USACO 1.44 母亲的牛奶
    随手练——汉诺塔问题(递归典型)
    Linux搭建lamp(Apache+PHP+Mysql环境)centos7.2版详细教程
    Windows 环境下安装redis 及其PHP Redis扩展
    Windows系统如何安装Redis
    phpstorm配置成sublime的代码高亮逼格风格
    phpstorm-----实现实时编辑服务器代码
    如何在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
    phpstorm取消自动保存,修改快捷键并标识修改的文件为星星标记
  • 原文地址:https://www.cnblogs.com/northern-light/p/8540406.html
Copyright © 2011-2022 走看看