Top "Spring-restcontroller" questions

@RestController is Spring MVC's shortcut annotation for creating Rest Controllers.

Reading HTTP headers in a Spring REST controller

I am trying to read HTTP headers in Spring based REST API. I followed this. But I am getting this …

java spring rest spring-restcontroller spring-rest
How to create a Spring Interceptor for Spring RESTful web services

I have some Spring RESTful (RestControllers) web services with no web.xml and I am using Spring boot to start …

spring-mvc spring-restcontroller spring-rest
When looking at the differences between X-Auth-Token vs Authorization headers, which is preferred?

What is the difference between the two headers below? Which one is preferred? X-Auth-Token : dadas123sad12 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

http http-headers spring-restcontroller
Could not verify the provided CSRF token because your session was not found in spring security

I am using spring security along with java config @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/…

java spring-security csrf spring-restcontroller
upload file springboot Required request part 'file' is not present

I want to add an upload function to my spring boot application; this is my upload Rest Controller package org.…

spring-boot upload postman spring-restcontroller
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:

i have some problem with my constructor in one my controller. I try to call one service in a constructor. …

java spring spring-mvc spring-restcontroller
Spring Boot binding and validation error handling in REST controller

When I have the following model with JSR-303 (validation framework) annotations: public enum Gender { MALE, FEMALE } public class Profile { private …

spring validation spring-mvc spring-boot spring-restcontroller
@RequestBody is getting null values

I have created a simple REST service (POST). But when i call this service from postman @RequestBody is not receiving …

spring spring-boot spring-restcontroller
415 Unsupported MediaType for POST request in spring application

I have a very simple Spring Application (NOT spring boot). I have implemented a GET and POST controller methods. the …

spring spring-mvc spring-restcontroller
Return HTTP 204 on null with spring @RestController

This returns 200 OK with Content-Length: 0 @RestController public class RepoController { @RequestMapping(value = "/document/{id}", method = RequestMethod.GET) public Object getDocument(@PathVariable …

java spring spring-mvc spring-restcontroller