zoukankan      html  css  js  c++  java
  • 分布式项目开发-springmvc.xmll基础配置

    基础步骤:

    1 包扫描

    2 驱动开发

    3 视图解析器

    4 文件上传解析器

    5 拦截器

    6 静态资源



    <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.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> <!-- 1 包扫描 --> <context:component-scan base-package="com.sxt.controller"/> <!-- 2 注解开发 --> <mvc:annotation-driven/> <!-- 3 视图解析器 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF"/> <property name="suffix" value=".jsp"/> </bean> <!-- 4 文件上传解析器 --> <bean name="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="defaultEncoding" value="utf-8"/> <!-- 使用的是字节 50M --> <property name="maxUploadSize" value="52428800"/> <!-- 可以设置一个临时的目录 uploadTempDir,但是注意,我们以上文件不放在tomcat ,需要放在文件 --> </bean> <!-- 5 拦截器 --> <!-- 6 静态资源 --> <mvc:resources location="/WEB-INF/statics/" mapping="/**"></mvc:resources> </beans>
  • 相关阅读:
    如何设计web系统的监控
    RedisCluster的rename机制失败报错,解决又是数据倾斜问题
    学习大数据基础资源收集与分享
    用过滤器实现日志记录
    HttpClient 教程
    【公告】
    【2020赛季训练实录】
    【BZOJ5415&UOJ393】归程(Kruskal重构树,最短路)
    【BZOJ3545&BZOJ3551】Peaks(kruskal重构树,主席树,dfs序)
    【CF1263E】Editor(线段树,栈)
  • 原文地址:https://www.cnblogs.com/topshark/p/10859618.html
Copyright © 2011-2022 走看看