Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在contextConfigLocation文件中添加多部分解析程序后出错_Java_Spring_Spring Mvc - Fatal编程技术网

Java 在contextConfigLocation文件中添加多部分解析程序后出错

Java 在contextConfigLocation文件中添加多部分解析程序后出错,java,spring,spring-mvc,Java,Spring,Spring Mvc,下面是我的contextConfigLocation文件,我在其中添加了bean标记,以将多部分解析器添加到我的项目中以上载文件,在这里添加此文件后,我将得到错误“HTTP状态404-类型状态报告 消息 说明请求的资源不可用。“ 请帮帮我,谢谢 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:

下面是我的contextConfigLocation文件,我在其中添加了bean标记,以将多部分解析器添加到我的项目中以上载文件,在这里添加此文件后,我将得到错误“HTTP状态404-类型状态报告 消息 说明请求的资源不可用。“ 请帮帮我,谢谢

 <?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:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="
            http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:annotation-config/>     
      <context:component-scan base-package="net.codejava.spring" /> 
<bean id="multipartResolver"
        class="org.springframework.web.multipart.commons.CommonsMultipartResolver">   
        <property name="maxUploadSize" value="20971520" /> <!-- 20MB -->

        <property name="maxInMemorySize" value="1048576" /> <!-- 1MB -->

    </bean>

</beans>


当我试图打开欢迎页面(主页)时,出现上述错误。检查您的视图是否存在?@Rembo:是的,如果我删除包含多部分解析器的bean,则输入代码工作正常。显示您在代码中使用多部分的位置。在上述xml文件中,您可以看到此标记