springboot 学习

参考:http://www.cnblogs.com/sam-uncle/p/8796212.html

 

spring boot 系列之一:spring boot 入门

注意:main启动类和controller包,必须同级

 

 

spring boot 系列之二:spring boot 如何修改默认端口号和contextpath

配置了port和context-path

我的代码如下

@RestController
@RequestMapping("hello")
public class HelloController {
    @RequestMapping(value = "say",method = RequestMethod.GET)
    public String sayHello() {
        return "hello ,spring boot";
    }
}

我的访问路径:http://localhost:8090/test/hello/say

 

spring boot 系列之三:spring boot 整合JdbcTemplate

同样的问题,所有包必须和main类同级,

然后在application.properties配置一下datasource就可以了。

 

spring boot 系列之四:spring boot 整合JPA

注意:Dao或者说Repository 只要创建 Interface就可以了。因为JpaRepository 或者 CrudRepository

已经实现了。

如果要添加额外的,那也是在Interface中添加,然后通过sql语句实现。

 

spring boot 系列之五:spring boot 通过devtools进行热部署

热部署,这一块我没试,以后用到再说。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值