<?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:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
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">
<!-- 扫描器,指定DispatcherServlet去扫描当前包名下的所有类, base-package属性不能精确到类级别,只能到包级别 -->
<context:component-scan
base-package="org.sprigmvc.pag" />
<context:component-scan
base-package="org.sprigmvc.dao" />
<!-- exception -->
<context:component-scan
base-package="org.sprigmvc.exception" />
<!-- 视图解析器 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean> <!-- 文件上传配置 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!--defaultEncoding:请求的编码格式必须和用户JSP的编码一致,以便正确读取表单中的内容。
uploadTempDir:文件上传过程中的临时目录,上传完成后,临时文件会自动删除
maxUploadSize:设置文件上传大小上限(单位为字节)-1为无限制 -->
<property name="defaultEncoding" value="UTF-8" />
<property name="maxUploadSize" value="102400000" />
<!-- uploadTempDir可以不做设置,有默认的路径,上传完毕会临时文件会自动被清理掉 -->
<property name="uploadTempDir" value="/upload/"></property>
</bean>
<!-- 处理器映射器 -->
<!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"
/> -->
<!-- 处理器适配器 -->
<!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"
/> -->
<!-- 配置注解驱动,配置之后就不用配置处理器映射器和处理器适配器了 -->
<mvc:annotation-driven />
<!-- 静态资源不拦截 -->
<mvc:resources location="/staticRescoures/"
mapping="/staticRescoures/**" />
<!-- 配置拦截器,可以配置多个拦截器,按顺序执行 -->
<!-- <mvc:interceptors>
第一个拦截器
<mvc:interceptor>
<mvc:mapping path="/**" /> 所有请求都拦截
<mvc:exclude-mapping path="/staticRescoures/**"/> 静态资源不拦截
<bean class="org.sprigmvc.Interceptor.MyInterceptor1" />
</mvc:interceptor>
第二个拦截器
<mvc:interceptor>
<mvc:mapping path="/**" /> 所有请求都拦截
<mvc:exclude-mapping path="/staticRescoures/**"/> 静态资源不拦截
<bean class="org.sprigmvc.Interceptor.MyInterceptor2" />
</mvc:interceptor>
</mvc:interceptors> -->
</beans>

Maven 默认 SpringMVC-servlet.xml 基本配置的更多相关文章

  1. springmvc 项目完整示例07 设置配置整合springmvc springmvc所需jar包springmvc web.xml文件配置

    前面主要是后台代码,spring以及mybatis的整合 下面主要是springmvc用来处理请求转发,展现层的处理 之前所有做到的,完成了后台,业务层和持久层的开发完成了 接下来就是展现层了 有很多 ...

  2. maven spark Scala idea搭建maven项目的 pom.xml文件配置

    1.pom.xml文件配置,直接上代码. <?xml version="1.0" encoding="UTF-8"?> <project xm ...

  3. Idea使用Maven搭建SpringMVC的HelloSpringMvc并配置插件Maven和Jetty

    这篇博文只是纯粹的搭建一个SpringMVC的项目, 并不会涉及里面配置文件该写些什么. 只是纯粹的搭建一个初始的Hello SpringMVC的项目. 废话不多说,上图. 1.  打开IDEA 并且 ...

  4. spring-mvc基于xml的配置

    配置web.xml <!--配置spring-MVC拦截--> <servlet> <servlet-name>DispatcherServlet</serv ...

  5. 利用maven开发springMVC项目(二)——框架配置

    申明:主要内容来源于大神博客(使用IntelliJ IDEA开发SpringMVC网站(二)框架配置),我只是用eclipse自己练习使用,记录下来也只是为了学习使用,没有任何的商业用途,侵权必删. ...

  6. 基于 SpringMVC——web.xml基本配置

    <!--声明应用范围内的初始化参数--> <context-param> <param-name>contextConfigLocation</param-n ...

  7. Maven+spring+springMVC+mybatis+Junit+Log4j配置个人总结

          首先粘贴上项目引用地址:http://doc.okbase.net/fengshizty/archive/126397.html 这里对创建步骤不做过多解释,只是针对案例创建demo的一些 ...

  8. 利用maven开发springMVC项目(三)——数据库配置

    前两节介绍了开发环境的搭建以及框架的配置 现在主要介绍在eclipse中如何将SpringMVC.hibernate.mysql数据库结合起来. 数据库配置 下面,就要通过一个简单的例子,来介绍Spr ...

  9. SpringMVC=>web.xml基本配置

    <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmln ...

  10. Java Servlet XML文件配置

随机推荐

  1. 【转】关于 Error[Pe020]: identifier "HAL_StatusTypeDef" is undefined

    @2019-06-06 [小记] 这个bug比较常见,右键可以定位到相关头文件,但系统依旧报错,其实主要还是头文件的问题. 1.需要检查头文件中关于主程序所用到的部分是否已经使能,尤其是 “stm32 ...

  2. 8.7.ZooKeeper Watcher监听

    1.ZooKeeper Watcher ZooKeeper 提供了分布式数据发布/订阅功能,一个典型的发布/订阅模型系统定义了一种一对多的订阅关系,能让多个订阅者同时监听某一个主题对象, 当这个主题对 ...

  3. jsp学习——九大内置对象

    JSP一共有九个内置对象,分别为:request.response.session.application.out.pagecontext.config.page.exception 博客:JSP的九 ...

  4. Hdu 1564 1*2矩阵覆盖棋局博弈

    n*n的矩阵如果n为偶数 则可被1*2的矩形完全覆盖 如果n为奇数 则除起点外 其他各自可被1*2矩形完全覆盖 所以当n为偶数 先手赢 n为奇数 后手赢 #include<bits/stdc++ ...

  5. java.sql.SQLException: Unknown column 'user0_.user_name' in 'field list' 报错问题

    报错信息: java.sql.SQLException: Unknown column 'user0_.user_name' in 'field list'Query is: select user0 ...

  6. 使用Quartus进行功能仿真时出现“testbench_vector_input_file option does not exist”的解决方法

    环境:本人使用的Quartus 18 Prime Standard Edition 1.新建一个vmf文件 ​ 添加Node或者Bus ​ 2.点击Processing->Start->S ...

  7. 关于.Net中Process和ProcessStartInfor的使用

    本文主要是介绍在.Net中System.Diagnostics命名空间下Process类和ProcessStartInfo类的使用 用于启动一个外部程序所使用的类是Process,至于ProcessS ...

  8. Codevs 4373 窗口(线段树 单调队列 st表)

    4373 窗口 时间限制: 1 s 空间限制: 256000 KB 题目等级 : 黄金 Gold 题目描述 Description 给你一个长度为N的数组,一个长为K的滑动的窗体从最左移至最右端,你只 ...

  9. 【CUDA 基础】3.4 避免分支分化

    - title: [CUDA 基础]3.4 避免分支分化 categories: - CUDA - Freshman tags: - 规约问题 - 分支分化 toc: true date: 2018- ...

  10. Java当中的集合框架Map

    简书作者:达叔小生 Java当中的集合框架Map 01 Map提供了三个集合视图: 键集 值集 键-值 映射集 public String getWeek(int num){ if(num<0 ...