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

 

posted @ 2019-01-19 17:14  ~沐风  阅读(208)  评论(0编辑  收藏  举报