Spring MVC bind on a typed field

I have a Spring MVC controller like this: @RequestMapping(value = "/search", method = RequestMethod.GET) @ResponseBody public Object grid(Search<MyFilter> search){ ... } My Search object is like: public class Search<...
more »

2017-01-12 17:01 (2) Answers

Parsing an array of long using jackson

I am getting the following error while calling my http method.(Spring boot application) "JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token". Its a DELETE call and I am passing my JSON as given...
more »

2017-01-09 10:01 (1) Answers

Jackson Mapping List of String or simple String

I'm trying to get some Json from an API and parse them into some POJO's to work with them but i have this case where i can get for a key a simple String or an arrayList of Strings. The Json looks like this : { "offerDisplayCategoryMapping": [ ...
more »

2017-01-06 12:01 (3) Answers

How to manage two sets of properties at runtime?

I'm building a web service that needs to switch between two sets of properties depending on the request URL coming in. I'm not sure which is the best method of handling this. I've got a Spring Boot app that has an yaml properties file. Inside the pr...
more »

2017-01-05 16:01 (3) Answers

How to avoid case sensitive keys in Spring cache?

I'm using Spring caching (with EHCache) on server side defining the cache key(s) within @Cacheable. The problem is that different clients send the same strings that are used as keys with different spelling as they send it case sensitive. The result i...
more »

2017-01-05 13:01 (0) Answers

Spring and Jackson: set json ignore dynamically

I have some JPA models: "Category" and "Article": @Entity @Table(name = "categories") public class Category { private int id; private String caption; private Category parent; private List<Category> childrenList; @Id @GeneratedValue(strategy =...
more »

2017-01-04 22:01 (2) Answers

Spring Boot Application

I am pretty new to Spring Boot Application. I wanted to understand how does a spring Boot Application create beans without @Configuration class . I had a look at a sample project where there was neither @Bean definitions nor a component scan yet @Aut...
more »

2016-12-25 04:12 (1) Answers

Serialize model without relation

I have two models: @Entity class ModelA { ... @OneToMany(mappedBy = "modelA") @JsonManagedReference private List<ModelB> modelBs = new ArrayList<ModelB>(); ... } @Entity class ModelB { ... @ManyToOne @JoinColumn(name =...
more »

2016-12-24 00:12 (1) Answers

Add existing java project to maven

I have the following problem: Using Eclipse, I created a maven Spring project running at localhost. My task is to create a deployment procedure for moving the local project to dev/production server. The flow is the following: I commit the changes t...
more »

2016-12-20 13:12 (1) Answers

What's JSON prefix used for?

I know it is a stupid question but I did not find expected answer by Google. One of new feature of Spring MVC 4.3 is supporting to configure JSON prefix <mvc:message-converters> <bean class="org.springframework.http.converter.json.Mappi...
more »

2016-12-11 03:12 (1) Answers

@JsonDeserialize causing HTTP 415

I have a Spring Boot application and I've written a custom Deserializer for one of my Entities. I've added @JsonDeserialize(using = GuestOrderDeserializer.class) to the Entity and now, anytime I try and access any of my endpoints that have to deseria...
more »

2016-12-09 23:12 (1) Answers