![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
文章平均质量分 92
progressDabinge
进击的攻城狮
展开
-
利用junit对springMVC的Controller进行测试
平时对junit测试service/DAO层已经很熟悉不过了,但是要测试controller层,不能总重启服务器吧,那么我们就用junit4模拟请求,测试controller层的方法。代码示例:import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;import原创 2016-04-18 17:53:19 · 16646 阅读 · 3 评论 -
spring mvc 异常处理Log4j配置
1.肯定是要导入相应的log4j包:log4j.x.jar包;2.在web.xml写入上下文: log4jConfigLocation classpath:log4j.properties 3.配置log4j.properties属性文件:# FATAL, ERROR, WARN, INFO, DEBUG log4j.root转载 2016-04-19 10:49:34 · 631 阅读 · 0 评论 -
Content-disposition中Attachment和inline的区别、ContentType设置
Content-disposition中Attachment和inline的区别Content-dispositionAttachment和inline的区别内嵌显示spring download内联显示 java web中下载文件时,我们一般设置Content-Disposition告诉浏览器下载文件的名称,是否在浏览器中内嵌显示.Content-dispositio转载 2016-09-19 17:23:35 · 24374 阅读 · 0 评论