spring-rest Questions
3
Now, my understanding, in general, is that @RequestMapping methods need to be public. Can they also be private? If so when would we use this?
The reason why I am asking this is that I noticed that...
Ambur asked 28/5, 2018 at 9:49
3
Solved
I have a exception class like follows
@ResponseStatus(value=HttpStatus.UNPROCESSABLE_ENTITY, reason="Unprocessable Entity") // 422
public class UnprocessableEntityException extends RuntimeExcepti...
Spahi asked 3/12, 2015 at 19:45
5
I am fetching the byte array using Spring Framework RestTemplate.
But I also need to fetch the media type of the fetched result.
The media type of this byte array can be of any type.
The code used ...
Shadoof asked 4/11, 2016 at 16:1
4
Solved
In my spring boot service, I'm using https://github.com/java-json-tools/json-patch for handling PATCH requests.
Everything seems to be ok except a way to avoid modifying immutable fields like obje...
Chops asked 1/5, 2018 at 22:4
3
Got sick of this annoying error:
java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap
at org.apache.catalina.util.ParameterMap.put(ParameterMap.java:164)
at org.s...
Ocampo asked 28/12, 2016 at 16:7
31
I'm working on REST API with spring boot. I need to log all requests with input params (with methods, eg. GET, POST, etc.), request path, query string, corresponding class method of this request, a...
Cowden asked 16/11, 2015 at 21:21
4
Solved
I am able to download a single file but how I can download a zip file which contain multiple files.
Below is the code to download a single file but I have multiples files to download. Any help wou...
Bubal asked 14/7, 2018 at 19:47
4
Solved
My object:
@Entity
@Table(name="user")
public class User {
@Id
@Column(name="uid")
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
//more code
}
When I POST user JSON...
Cress asked 26/7, 2017 at 8:57
7
Solved
I'm using spring RestTemplate for communication with a xml webservice backend as follows:
ResponseEntity<MainDTO> dto = restTemplate.postForObject(url, postData, MainDTO.class);
Problem: t...
Handmade asked 4/3, 2016 at 13:50
2
Solved
Is it possible to read data from DB, process it and in ItemWriter send to another system using RestAPI (REST TEMPLATE) in Spring batch project? All I can see is fetch data and write it in a csv fil...
Ames asked 26/9, 2021 at 19:1
2
Solved
How can I get the raw json string from spring rest template? I have tried following code but it returns me json without quotes which causes other issues, how can i get the json as is.
ResponseEnti...
Adena asked 3/11, 2017 at 20:45
1
I have a spring boot(version 2.1.8.RELEASE) rest application that contain the following mail functionality from the controller:
@PostMapping(value = "/sendMail1")
public @ResponseBody EmailRespons...
Marquez asked 17/10, 2019 at 9:53
7
Solved
I am handling REST exceptions using @ControllerAdvice and ResponseEntityExceptionHandler in a spring Rest webservice. So far everything was working fine until I decided to add the URI path(for whic...
Isometropia asked 19/8, 2018 at 20:34
5
I have an API that has different consumers. I'd like them to get relevant documentation based on their roles in Spring Security.
E.g
API operation A is constricted to Role A and Role B
API operatio...
Inflated asked 3/1, 2017 at 13:59
4
Solved
I'm trying to understand the readTimeout available on restTemplate, what is it exactly ?
Is it the the total amount of time the request can take before we get the timeout exception ?
Salientian asked 16/8, 2017 at 12:38
7
I have a sample spring rest mvc application which has the following java code:
SampleController.java
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Au...
Monto asked 24/11, 2015 at 7:22
2
Solved
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);
JSONObject ...
Inweave asked 25/1, 2017 at 11:1
3
Solved
I was playing around spring security and trying to secure an restful application, but then ran into this rather absurd problem. All the action on my controllers are fine and the requests are accept...
Sverdlovsk asked 23/6, 2019 at 9:46
4
Solved
I have worked in Jersey and RESTEasy framework earlier and now we will be using Spring Rest for a new project , I don't want to pass all the query params and matrix params as parameters in the meth...
Flatways asked 9/1, 2016 at 5:40
2
Solved
I created an integration test for asynchronous rest controller method. Which looks like:
@Test
public void shouldHandleRequestsAsynchronously() throws Exception {
MvcResult mvcResult = this.moc...
Presentational asked 31/3, 2018 at 22:26
3
I am trying to design a rest api, and below is my controller code.
when i invoke http://localhost:8080/ the response is fine, but if i hit http://localhost:8080/api/ca it thorws javax.servlet.Ser...
Swaney asked 21/2, 2019 at 8:2
6
Solved
I have some Spring RESTful (RestControllers) web services with no web.xml and I am using Spring boot to start the services.
I want to add authorization layer for the web services and wanted to ro...
Pierre asked 13/7, 2016 at 19:31
3
Solved
Using Spring boot 1.3.1
I don't understand why @RestController are Transactionnal by default.
I haven't found anything saying so in the docs.
Example which pushes this fact that the method findOn...
Mervin asked 6/1, 2016 at 19:57
2
Solved
One of our application is invoking another application via a Spring Rest Template.
HttpEntity<Object> httpEntity = new HttpEntity<>(null);
restTemplate.exchange(URL, HttpMethod.GET, ht...
Gurl asked 20/12, 2017 at 8:5
4
I have a rest controller class as follows which throws custom exception when user object is invalid. But those exception got wrapped by spring framework and not handled by the specific exception ha...
Mantelpiece asked 17/9, 2018 at 9:43
1 Next >
© 2022 - 2024 — McMap. All rights reserved.