• Now all data be ready for publish, We had made our blog alive now. Haha.



  • These days CCP GFW blocked all the IPs from US and when I switch my IP in google Cloud, the disk data cannot be restore again. I have to restart my blog totally, Now the website is still building…



java8 几个特殊的对象

java8 几个特殊的对象

1. 函数式接口 @FunctionalInterface 定义: 首先是一个接口,然后就是在这个接口里面只能有一个抽象方法 用途: 它们主要用在Lambda表达式和方法引用(实际上也可认为是Lambda表达式)上 如定义了一个函数式接口如下: @FunctionalInterface interface GreetingService ……

10-26 DETAIL
Spring BeanUtils.copyProperties,BeanUtil.copyProperties 和MapStruct

Spring BeanUtils.copyProperties,BeanUtil.copyProperties 和MapStruct

Object mapping 的技术分类: * 运行期 反射调用set/get 或者是直接对成员变量赋值 。 该方式通过invoke执行赋值 *,实现时一般会采用beanutil, Javassist等开源库。这类的代表:Dozer,ModelMaper * 编译期 动态生成set/get代码的class文件 ,在运行时直接调用该class文件。* 该方式实……

10-26 DETAIL
BeanUtils.copyProperties VS PropertyUtils.copyProperties

BeanUtils.copyProperties VS PropertyUtils.copyProperties

大范围两个工具类都是对两个bean之前存在name相同的属性进行处理,无论是源bean或者目标bean多出的属性均不处理 属性名称相同,但是类型不同, 使用 PropertyUtils,会保错:Caused by: java.lang.IllegalArgumentException: argument type mismatchBeanUtils.cop……

10-24 DETAIL
Avoid WHERE 1 = 1 in SQL

Avoid WHERE 1 = 1 in SQL

The most common thing to do in dynamic SQL is conditionally include a part of a where clause. For example: <select id="findActiveBlogLike" resultType="Blo……

10-24 DETAIL
Spring Data JPA map the native query result to Non-Entity POJO- Stack Overflow

Spring Data JPA map the native query result to Non-Entity POJO- Stack Overflow

Question I have a Spring Data repository method with a native query @Query(value = "SELECT g.*, gm.* FROM group g LEFT JOIN group_members gm ON g.group_id = gm.group_id and……

10-23 DETAIL
Using Spring MVC Test to unit test multipart POST request- Stack Overflow

Using Spring MVC Test to unit test multipart POST request- Stack Overflow

Question I have the following request handler for saving autos. I have verified that this works when I use e.g. cURL. Now I want to unit test the method with Spring MVC Test. I ha……

10-23 DETAIL
Spring: how do I inject an HttpServletRequest into a request-scoped bean?- Stack Overflow

Spring: how do I inject an HttpServletRequest into a request-scoped bean?- Stack Overflow

Question I’m trying to set up a request-scoped bean in Spring. I’ve successfully set it up so the bean is created once per request. Now, it needs to access the HttpSer……

10-23 DETAIL
Spring MVC Multipart Request with JSON- Stack Overflow

Spring MVC Multipart Request with JSON- Stack Overflow

Question I want to post a file with some JSON data using Spring MVC. So I’ve developed a rest service as @RequestMapping(value = “/servicegenerator/wsdl”, method……

10-23 DETAIL
Configuring Spring Security 3.x to have multiple entry points- Stack Overflow

Configuring Spring Security 3.x to have multiple entry points- Stack Overflow

Question I have been using Spring Security 3.x for handling user authentication for my projects, and so far, it has worked flawlessly. I recently received the requirements for a n……

10-23 DETAIL
No mapping found for HTTP request with URI [/WEB-INF/pages/apiForm.jsp] [duplicate]- Stack Overflow

No mapping found for HTTP request with URI [/WEB-INF/pages/apiForm.jsp] [duplicate]- Stack Overflow

Question This question already has an answer here: Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServl……

10-23 DETAIL