• springservlet.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"
        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">
    
    </beans>

    解析包(@Controller)

    <mvc:annotation-driven />

    扫描包

    <context:component-scan base-package="/*packagePath*/" />

    配置视图

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
            <property name="prefix" value="/WEB-INF/pages/" />
            <property name="suffix" value=".jsp" />
    </bean>

    设置上传文件大小

    <bean id="multiPartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" >
            <property name="maxUploadSize" value="5000000" />
    </bean>
  • 相关阅读:
    numpy数组(一)
    Iterator和Iterable区别:
    jupyter notebook安装相关问题
    Selenium+Headless Firefox配置
    最长不重复子串
    deprecated conversion from string constant to 'char*
    c++求字符串
    原型模式(Prototype)
    工厂方法模式(Factory Method)
    素数序列的生成及其应用(采用了自研的高效算法)
  • 原文地址:https://www.cnblogs.com/cmelody/p/6478350.html
Copyright © 2020-2023  润新知