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

Is there application Scope in spring?

I saw 'application' scope in the following blog. Is it true? http://www.concretepage.com/spring/spring-bean-scope-example-using-scope-annotation-and-xml-for-singleton-prototype-request-session-global-session-and-application-scope-with-scoped-proxy ...
more »

2017-06-05 06:06 (2) Answers

Eclipse merge two java projects

I am using Eclipse to develop a Java project to run on a server. I have two projects: 1) jbosswildfly: one with Java code made up of a number of RESTful Services, and a Maven pom. 2) theWhoZoo-web: the other is a web project containing a few html...
more »

2017-05-31 13:05 (2) Answers

Spring Rest Controller Patch implementation

I need to implement PATCH functionality at my Spring @RestController. I saw a lot of questions and the most common approach is to use a plain Java Map to do this. Map that allows null helps to solve the issue with null or absent values because it lo...
more »

2017-05-21 21:05 (0) Answers

PUT request with using Ajax(processing Spring)

I want to send PUT request with using Ajax. I send request with necessary information: newNavigation. PUT request: var newNavigation; var newInputNavigation = document.getElementById('newInputNavigation'); newNavigation = newInputNavigation.value;...
more »

2017-05-21 11:05 (1) Answers

org.webjars in SpringBoot app

I have a basic SpringBoot app. using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file. I also have this property defined in my application.properties server.contextPath=/appContext I have this ...
more »

2017-05-20 21:05 (0) Answers

Spring 3.0.5 Hibernate Maven Error

I am trying to learn spring , maven and eclipse. I got this issue. I am trying to set up Spring + Hibernate Maven web project. When i start server and open the jsp page i get this error. I have searched a fix for this issue but most of answers is re...
more »

2017-05-14 11:05 (1) Answers

User search in RESTful spring API

So basically, I have a spring API with MySQL database and I need to be able to perform search of a user by his name in front-end web app which is using my API. The trick is that I need a kind of google search so by typing, lets say, 3 letters, list o...
more »

2017-05-12 19:05 (1) Answers

No converter found for return value of type

Model class (getters and setters ommitted for brevity) import javax.persistence.*; import java.io.Serializable; import java.time.LocalDate; @Entity @Table(name = "users") public class User implements Serializable { @Id @GeneratedValue @Column...
more »

2017-05-07 03:05 (0) Answers

Spring MVC force Jackson to only use setters

I have a Spring MVC application which uses Jackson and the @RequestBody annotation. I have a field in the POJO that I do not want Jackson to map, so I have lombok set the setter access level to NONE. @NotNull @Setter(AccessLevel.NONE) private boole...
more »

2017-05-02 16:05 (1) Answers