- 博客(9)
- 资源 (4)
- 收藏
- 关注
原创 《有用的单元测试》 读书笔记
有效的测试文章目录有效的测试第4章 断言第5章 可维护性第6章 可信赖第7章 指南第9章 加速执行测试第4章 断言看见魔数的时候,或者!= == 这样的判断的时候,要考虑是否足够抽象,一个测试应该只有一个失败的原因,过度assert不要过度断言,任何一点小的改变都会使得测试失败不要在断言中使用位运算准备-执行-断言内敛数据或者逻辑,不要轻易使用外部数据文件不要使用魔数冗长的s...
2019-07-28 12:02:43
223
原创 bean 中使用属性占位符${}的问题
最近在读spring mvc 的官方文档,读到Controller 的时候,发现官方文档中,文档中如下片段:URI path patterns can also have embedded ${…} placeholders that are resolved on startup by using PropertyPlaceHolderConfigureragainst local, sy...
2018-12-14 19:11:16
1567
转载 转:ContentNegotiatingViewResolver 和 HttpMessageConverter+ResponseBody注解的作用
最近学习spring mvc ,看到了ContentNegotiatingViewResolver 和 spring mvc的Content Negotiating,于是想不通viewResolver 和HttpMessageConverter 的适用范围。看到了下面这篇文章。之前一直在用@ResponseBody注解的方式进行restful开发,在看书的时候又看到了ContentNegoti...
2018-12-14 16:35:36
266
原创 spring boot 官方文档翻译28 Developing Web Application
文章目录28 Developing Web Application28.1 The “Spring Web MVC Framework”Spring MVC 自动配置HttpMessageConvertersCustom JSON Serializers and DeserializersMessageCodesResolverStatic ContentWelcome PageCustom Fa...
2018-12-04 11:09:02
415
原创 Spring boot reference guide 23-25
Part IV. Spring Boot Feature文章目录Part IV. Spring Boot Feature23. SpringApplication23.2 自定义banner23.3 自定义SpringApplication23.4 流式构建API23.5 事件和监听器23.6 web 环境23.7 访问应用参数23.8 ApplicationRunner 和 CommandLi...
2018-11-21 15:44:23
520
原创 spring boot reference first 20 chapter
文章目录Srping Boot 官方文档阅读Part II. Getting start11.3 Writting the code@RestController and @RequestMapping@EnableAutoConfiguration11.5创建可执行jar包Part III. Using Spring Boot13 Build Systems13.1 spring-boot-st...
2018-11-06 20:49:13
271
原创 Cannot forward after response has been committed
在写servelt实现文件下载的时候,提示如下错误 Cannot forward after response has been committed从错误的含义上来看是因为重复提交了已经提交的请求,于是回去看代码,发现了如下问题, catch (FileUploadException e) { e.printStackTrace(); request.setAttribute("e
2016-07-24 21:15:04
278
原创 servlet实现文件下载
[java] view plain copy1.总的流程介绍 出于安全的考虑一般情况下,我们会将服务器的文件或者用户上传的文件放在WEB-INF目录的子目录下,所以不能直接通过的形式实现静态下载。所以,文件下载的一般流程是,连接设为servlet,然后在servlet中将文件输送到用户客户端。比如在jsp界面设置如下[h
2016-07-23 21:15:48
442
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人