Spring MVC 4 + Jackson + LocalDate

I am using Spring MVC 4 with Jackson API for databinding and I am having some issues while using Java 8 Dates, like LocalDate and LocalTime. Here is my Ajax: var response = $.ajax({ url: 'parcela', method: 'POST', data: { formaPagamentoPrazo: t...
more »

2017-02-13 18:02 (1) Answers

Use custom jackson mapper on spring boot endpoints

I want to use different jackson ObjectMapper instance ( instead of the one used on other mapped urls ) on endpoints derived from AbstractEndpoints. To clarify the question, I don't want to change or customise the object mapper which is used by diff...
more »

2017-02-10 14:02 (2) Answers

Why the POST request becomes a GET request?

When I use jQuery's $.ajax() or $.post() method to send form information to server, the 'data' string is added to the end of the url. Why the POST request becomes a GET request? The form code shown below <form role="form" class="form-horizontal"&...
more »

2017-01-20 08:01 (1) Answers

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

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 mvc async execution

I'm trying to execute simplest async REST controller using java.util.concurrent.Callable: @RequestMapping("/AsyncRequest") public Callable asyncRequest() { return () -> { Thread.sleep(3000); return "reply"; }; } Then I r...
more »

2016-12-27 20: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

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