zoukankan      html  css  js  c++  java
  • springboot(十四):springboot整合mybatis

    org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=

    在使用工具测试(Postman、 swagger )时报如下异常

    解决方案:

    去掉 @RequestBody 注解就行了

       @RequestMapping(value = "/search", method = RequestMethod.POST)
        public PageResult search(@RequestBody TbBrand brand, int page, int rows){
            return brandService.findByPage(brand, page, rows);
        }

     使用spring-boot-devtools进行热部署以及不生效的问题解决

    (1)在Maven中添加依赖

     <!-- Spring boot 热部署 -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <optional>true</optional>
            </dependency>

    (2)在插件配置

    <!-- fork: 如果没有配置该项配置,devtools不会起作用的,即应用不会restear -->
                    <configuration>
                        <fork>true</fork>
                    </configuration>

    但是,为什么配置了还是没有用呢 ?!

    这是因为idea默认是没有自动编译的,我们这里需要添加修改配置.打开设置

    1)File-Settings-Compiler-Build Project automatically

     (2)ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running

  • 相关阅读:
    一、Python概念知识点汇总
    在ubuntu永久添加alias
    字符串转化为数字 不用sscanf
    python class类
    《Effective C++》笔记
    问到面向对象该如何回答
    数字和字符串互相转换
    python input print 输入输出
    《c专家编程》笔记
    判断是否是回文数
  • 原文地址:https://www.cnblogs.com/cnki/p/10292327.html
Copyright © 2011-2022 走看看