What is taking long on Jetty startup?

Starting Jetty there's a long delay (8s) before my web application starts loading 13:50:10 [INFO] jetty-9.4.5.v20170502 13:50:18 [INFO] Scanning elapsed time=146ms With debug logging turned on there are two interesting steps Extracting dependent...
more »

2017-08-09 14:08 (1) Answers

Restrict JSON attributes for @RequestBody

This may be a simple task, but I couldn't find a way to do it. Basically, I need to disallow some parameters at the time of using @RequestBody annotation in my controller. Here is my model: @Data public class MyModel { private int id; private S...
more »

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

Best way to send file from java server to client

I uploaded an image successfully in MYSQL database using spring MVC(MultipartFile) and hibernate. now I want to get it from db and set it in my page with ajax request and my request is done successfully .(server response is ok) but the server(java) ...
more »

2017-08-03 16:08 (1) Answers

JsonMappingException when parsing json to Object

I want to change json to object by jackson, and the object contains Date type field. Exception: com.fasterxml.jackson.databind.JsonMappingException: Failed to parse Date value '30-Mar-2017' (format: "dd-MMM-yyyy"): Unparseable date: "30-Mar-2017...
more »

2017-08-02 11:08 (1) Answers

How to hide @RequestMapping parameter?

I have a Servlet with a parameter bean. The bean has some fields that should no be able to override by the users get-query. How can I achieve it? None of the following worked: @JsonIgnore @XmlTransient @JsonIgnoreProperties private String somefiel...
more »

2017-07-07 16:07 (1) Answers

No repository found for domain type

In java spring mvc app. Here is the Git repository of the code. I have the below entity: package com.example.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import lombok.Data; @Dat...
more »

2017-06-29 10:06 (1) Answers

Microservices Restful API - DTOs or not?

REST API - DTOs or not? I would like to re-ask this question in Microservices' context. Here is the quote from original question. I am currently creating a REST-API for a project and have been reading article upon article about best practices....
more »

2017-06-15 18:06 (2) Answers

How to self describe a REST api with Spring?

I'm using spring-mvc to create servlets like: @RestController public class MyServlet { @GetMapping("/test") public MyRsp test(MyReq req) { //... } } Now if the user accesses the root of my app localhost:8080/my-app, it should sho...
more »

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

Spring Boot request body semi-required fields

In our application user can write a message based on user id or screen name. class Message { public final Long userId; public final String screenName; public final String text; @JsonCreator public Message(@JsonProperty(value = "...
more »

2017-06-09 16:06 (3) Answers