A simple workaround for "Cannot find a (Map) Key deserializer"
12jackson InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class XXXX]
12jackson InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class XXXX]
In recent times, I did a lot practise of micro-service with spring boot. And handled a lot of JSON(Jackson) related serialization and deserialization issues. In this post, I will share some tricky how to “fix” Circular References.
这篇文章将简单介绍一下如何用Jersey(DropWizard)在一次Request中接受多个文件。其实Google一下,SO上会有很多回答,只是在这边献丑一下。
其实下面这些个assert语句都可以通过junit测试。 12345678@Testpublic void integerValueOfTest() { Assert.assertTrue(Integer.valueOf(-128) == Integer.valueOf(-128)); Assert.assertFalse(Integer.valueOf(128) == Integer.valueOf(128)); Assert.assertTrue(Integer.valueOf(127) == Integer.valueOf(127)); Assert.assertTrue(Integer.valueOf(1) == Integer.valueOf(1)); Assert.assertFalse(Integer.valueOf(1000) == Integer.valueOf(1000));}
这是我在StackOverflow上提的第一个问题:Why Objects.hash() returns different values for the same input?
由于长时间在自己coding中处理英文内容,导致今天发现自己在做的一单网站在给用户发新密码邮件的时候居然中文乱码。(原来我每天都说的中文在我写代码的时候被忽略了)
I am implementing a RESTful server inside my company. The workflow is very straight-forward: request and response. However, nothing is easy, the RESTful service is based on an existed project, which handles database operations, and the entities inside that project is pretty complex(a lot of interfaces and abstract classes).
There are many ways to check whether a file is image. For example, check the file extension(jpg, png, gif …). But this is not so safe, in a web environment, user may rename XXX.exe, to XXX.jpg, then s/he can succeed to upload it. In this case, it can induce security problem.
It is a simple function that can identify the credit card type by its number. Get help from this page: http://www.regular-expressions.info/creditcard.html