Top "Spring-rest" questions

Use this tag for question about the REST architectural style used in Spring framework

spring CORS and angular not working : HTTP status code 403 error

I am new to angular and spring-security.I am having problem with CORS when trying to log in from angular …

java spring angular spring-rest
How to get request's URI from WebRequest in Spring?

I am handling REST exceptions using @ControllerAdvice and ResponseEntityExceptionHandler in a spring Rest webservice. So far everything was working fine …

spring spring-mvc spring-rest
How to debug 404 resource not found in spring mvc rest?

I have a sample spring rest mvc application which has the following java code: SampleController.java import org.apache.logging.…

java maven spring-restcontroller spring-rest
Spring Boot REST path mapping

I'm just thinking, what is the best practice to create PATH mapping for rest service. Let's say we have following …

spring spring-boot spring-restcontroller spring-rest
How to use RestTemplate with multiple response types?

I'm using spring RestTemplate for communication with a xml webservice backend as follows: ResponseEntity<MainDTO> dto = restTemplate.postForObject(…

java spring spring-rest
Custom Permission Evaluator Spring

I want to create a custom Permission Evaluator in order to @PreAuthorize a REST Endpoint with a custom method. I …

java spring-boot spring-security spring-rest
RestTemplate can't fetch JSONObject

I can't fetch JSONObject directly, this code works: RestTemplate restTemplate = new RestTemplate(); String str = restTemplate.getForObject("http://127.0.0.1:8888/books", String.class); …

spring resttemplate spring-restcontroller spring-rest
Does Spring create new thread per request in rest controllers?

I wanted to learn non blocking REST, but first I wrote blocking controller for comparison. To my surprise Spring doesn't …

spring spring-mvc spring-restcontroller spring-rest
Spring RestTemplate exchange POST HttpClientException with any non 200 OK response

So the current issue I am having is I am getting a Servlet.service() for servlet [dispatcherServlet] in context with …

java spring-boot spring-mvc spring-rest
MockRestServiceServer: how to mock a POST call with a body?

I am trying to mock a POST method with MockRestServiceServer in the following way: MockRestServiceServer server = bindTo(restTemplate).build(); server.…

java spring spring-boot junit spring-rest