码迷,mamicode.com
首页 > 其他好文 > 详细

The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive re

时间:2018-08-25 20:36:26      阅读:1031      评论:0      收藏:0      [点我收藏+]

标签:orm   导致   coding   str   roc   enc   nta   情况下   文件   

使用SpringMVC,页面跳转时出现Bad Request:

信息如下:

Type Status Report

Message Required String parameter ‘description‘ is not present

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

Message那里的‘description’是表单的一个参数,因为这个是第一个参数,所以只显示了description。使用springmvc上传文件功能时出现Bad Request,除了表单类型与@RequestParam POJO的属性类型不一致导致的原因外,还有一个可能性原因,就是没有配置MultipartResolver,因为springmvc默认情况下没有装配MultipartResolver,下面是配置MultipartResolver:

<!-- 配置上传文件 -->
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize">
            <value>10485760</value>
        </property>
        <property name="defaultEncoding">
            <value>UTF-8</value>
        </property>
    </bean>

 

The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive re

标签:orm   导致   coding   str   roc   enc   nta   情况下   文件   

原文地址:https://www.cnblogs.com/SysoCjs/p/9535207.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!