上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页

2020年4月22日

138-bathPath的作用?

摘要: 在html中他的根路径/代表的是localhost:8080,并没有项目名。假使我们不配置basePath,也没有/,则页面的跳转路径是按照相对路径来算的/没有项目名的主要是解决我们项目名经常变化的问题 thymeleaf中的/自动加上了项目名,这一点和普通的html是不一样的。 <% String 阅读全文

posted @ 2020-04-22 12:48 十年磨三劍 阅读(211) 评论(0) 推荐(0) 编辑

137-redis如何实现String序列化?

摘要: redisTemplate.setKeySerializer(new StringRedisSerializer());传输的时候依然使使用的字节流传输,只不过我们在可视化数据库中显示的是字符串 阅读全文

posted @ 2020-04-22 08:22 十年磨三劍 阅读(582) 评论(0) 推荐(0) 编辑

2020年4月21日

33-Redis (error) NOAUTH Authentication required?

摘要: 出现这个问题说明redis的登陆需要密码解决:登录后输入命令:auth 123123(密码)也可以以在登录的时候输入密码:redis-cli -a 123123(密码) 但是我怎么关闭呢? 另外我的数据库是没有值的呀? 难道应了老师那句话,把他放到了缓存中 阅读全文

posted @ 2020-04-21 22:25 十年磨三劍 阅读(200) 评论(0) 推荐(0) 编辑

136-如何访问redis数据库

摘要: //当我们使用Redis的时候,并没有注入Mapper,反而时注入了一个redisTemPlate @Autowired private RedisTemplate<Object,Object> redisTemplate; @Override public Integer queryUserCou 阅读全文

posted @ 2020-04-21 21:54 十年磨三劍 阅读(684) 评论(0) 推荐(0) 编辑

135-如何实现result风格

摘要: @RequestMapping(value = "/user/{id}") //注意id的默认值是1,不是0也不是null;传参时:localhost:8080/user/9999 public Object user1(@PathVariable("id") Integer id) { retur 阅读全文

posted @ 2020-04-21 20:27 十年磨三劍 阅读(447) 评论(0) 推荐(0) 编辑

134-SpringMVC中的值,会有一个默认值

摘要: 局部变量必须有值,默认值就是1,也就是说id默认值就是1,不是null,也不是0 @RequestMapping(value = "/user") public Object user(Integer id) { return "user = " + id; } 阅读全文

posted @ 2020-04-21 20:08 十年磨三劍 阅读(279) 评论(0) 推荐(0) 编辑

133-this知识点

摘要: 1.this代表的是当前对象的引用。通常而言那个对象调用这个方法,这个方法中的this就代表那个对象。 public vide detail(){ System.out.println(this.nam);//通常this都可以省略 } 2.为什么构造方法也会有this呢?按理来说此时还没有对象啊? 阅读全文

posted @ 2020-04-21 14:09 十年磨三劍 阅读(118) 评论(0) 推荐(0) 编辑

2020年4月20日

132-SpringBoot中的请求方法

摘要: @RestController //相当于类上加@Controller + 方法上加@ResponseBody,要求该类中所有方法返回的都是JSON对象 public class StudentController { //该方法即支持get请求也支持post请求 @RequestMapping(v 阅读全文

posted @ 2020-04-20 21:13 十年磨三劍 阅读(202) 评论(0) 推荐(0) 编辑

034-405是什么错误?

摘要: 当一个方法规定只能使用post访问时,我们使用了get访问,就会出现405错误。 阅读全文

posted @ 2020-04-20 20:08 十年磨三劍 阅读(143) 评论(0) 推荐(0) 编辑

131-逆向工程配置文件

摘要: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://m 阅读全文

posted @ 2020-04-20 19:31 十年磨三劍 阅读(169) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页

导航