How to send Date in REST API in POST method

I am trying to build RESTful web service with Spring support. I am getting following exception when I am trying to send POST request. Input: POST http://localhost:8080/InventoryDemo/item In JSON Payload: {"materialId":"ID02","materialName":"...
more »

2017-08-14 08:08 (3) Answers

spring data rest post sub-resource

I am using spring data rest and want to post a new resource and its sub-resource.Both of them are new resource so there is no link pointing to either of them.In fact,the following json is a reasonable json I think to post the new resource and its su...
more »

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

Error creating bean with name 'validator'

I'm trying to create bean validation (I'm using tomcat server 7). When I added this piece of code @Bean public Validator validator() { return new org.springframework.validation.beanvalidation.LocalValidatorFactoryBean(); } I got the error org...
more »

2017-08-12 12:08 (2) Answers

Relative path in 'file' protocol for URL

I have an implementation which reads a file and uses java.net.URL to take a path to open connection to. In production code, the link of file will be on FTP but for testing the logic I want to use a file locally which I can read using file protocol i...
more »

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

Spring REST Repository based on User Data

I am coding an app where the user works into a "Business activity". So every time a new user registers himself a new Business activity is created (or the user can join an active Business activity). In this app there are various entities, let's take ...
more »

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

2 @RestControllers with different configurations

Is it possible to have two different @RestControllers that use different MappingJackson2HttpMessageConverter in Springboot ? ... or is the MappingJackson2HttpMessageConverter common for all @RestController in a spring boot application ? Basically, t...
more »

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

Error 404 on PUT request while having a GET

Got a small problem on my rest server. It's based on spring web framework. Here's the code that poses me problems : @RestController @RequestMapping("users") public class usersWS { //some other functions //works @RequestMapping( ...
more »

2017-08-09 12:08 (0) Answers

Cannot use hibernate EHCache

I write web application using Spring Boot 1.5.4.RELEASE and I try to implement caching entities in my application using Hibernate EHCache. But when I call method findAll() from repository I get an error. I don't know what is the reason. Cachable co...
more »

2017-08-08 17:08 (0) Answers

How to test file upload in spring boot?

I have implemented a rest service similar to this one. UserController.java @RestController @RequestMapping(path = "/user") public class UserController { private final UserService userService; @Autowired public UserController(UserService use...
more »

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

username null in spring security 4

I used spring security 3 and I decided to upgrade it to Spring security 4 when I do it I face to a problem. the problem is when I POST my username and password to my custom userDetailService from login form , the username is null. <form action="&...
more »

2017-08-07 12:08 (1) Answers