Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
3 answers
451 views

I am developing a Controller in Spring Boot. In case the item is not found in the DB I would like to resurrect a ResponseEntity with Http code of type HttpStatus.NOT_FOUND, but also a message saying ...
1 vote
1 answer
88 views

I use Angular to read http header from Java Spring Boot, It works fine in Postman. I can read all the headers. But when I use Angular, I got status 200, but null for headers. Please help. Where did i ...
0 votes
0 answers
37 views

How should error responses be handled properly? When I need to return a class, I use ResponseEntity<Class>. However, if I want to return an error as plain text (string), I would need to use ...
1 vote
2 answers
225 views

I am using rest template to call API, when I hit the API using rest template it returns some garbled characters like Chinese. ResponseEntity<String> response = restTemplate.exchange(url, method, ...
-1 votes
1 answer
3k views

I'm working with ResponseEntity<> in a Spring Boot project and I want to know if it's mandatory to check the responseBody object for null before calling getBody()? For ex: ResponseEntity<...
0 votes
1 answer
327 views

So I have this problem where I need to return huge SQL results (millions of rows) to the client as a file. To break the problems, I split them into two: Streaming SQL results from DAO to Service ...
1 vote
1 answer
2k views

I am encountering an issue while consuming an API that returns a JSON string. When attempting to convert the JSON string response from the API to a Map<String, Object>, it throws an error. ...
1 vote
1 answer
2k views

I've found two approaches of returning error status codes from RESTful API: the first is traditional using ResponseEntity<>. The second one is to create specific exceptions for status codes and ...
0 votes
1 answer
68 views

I write a rest spring boot that return List<Map<String,Object>> as response. public List<Map<String,Object>> getAll(@Valid DataRequestDto dto) { List<Map<...
0 votes
0 answers
202 views

I have the below code - after executing below code the client getting immediate response with blank zip file (with out having list of files) , however the StreamingResponseBody Still executing by ...
0 votes
2 answers
335 views

When i run my spring boot application it returns an empty arraylist which i'm at alas on what is going on, because everything looks correct to me, here are my codes Checkout the images of the classes ...
1 vote
0 answers
109 views

I am working on a service has to forward the incoming requests to a destination service after performing some alterations on the object received in the request body and return the response received ...
1 vote
1 answer
1k views

In Mockito test cases, I m facing this response entity is null error which ideally should not be happening as I have mocked the response entity as well. My Code: Mockito.when(restTemplate.exchange(...
1 vote
2 answers
3k views

I never worked with WebClient before, but I have to use it to send a Post request to an external url. After that I check the response status, and if it's 204 I'll continue with the process, but if the ...
0 votes
0 answers
538 views

So I have a method @GetMapping( value = "/download/{fileId}", produces = { MediaType.APPLICATION_OCTET_STREAM_VALUE } ) public ResponseEntity<...

15 30 50 per page
1
2 3

AltStyle によって変換されたページ (->オリジナル) /