springboot开发使用

springboot开发使用


Eclipse开发使用springboot

在http://start.spring.io/官网上下载springboot架构,导入eclipse工程,加上spring-boot-starter-web依赖包,开发使用
Idea开发使用
在相关项目结构下载,建立工程,其中可能会因为网络问题导致无法运行,需重新导入依赖包。
配置热部署
添加spring-boot-devtools依赖,并配置idea中有关热部署的配置。
springboot定时任务
应用场景,到需要隔一段时间发送一次请求时,则可以用到springboot定时任务,打开启动类中注解@enablescheduling,创建定时任务类,方法上使用scheduled(fixedRate=6000),fixeddelay/cron实现定时。
Properties和yml的区别。Yml配置层次感更强方便查看。
Springboot集成mybatis时遇到的问题
mapper注入问题,其一出现原因mybatis-spring-boot-starter包缺失,或不完全。其二注解启动类注解@MapperScan(“com.example.demofirst.dao”)。mapper.xml无法被springboot扫描到 ,运行时打包在resources下而不再java下,需在pom中配置打包位置

        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>com/example/demofirst/dao/mapper/*.xml</include>
                </includes>
            </resource>
        </resources>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值