Questions tagged [spring-restcontroller]

@RestController is Spring MVC's shortcut annotation for creating Rest Controllers. Use this tag for questions relating to the use of this annotation.

@RestController is an Spring annotation that is used to declare controllers where all @RequestMapping annotated methods assume @ResponseBody semantics by default.

Useful links:

1579 questions
0
votes
1 answer

spring security with angular2 giving 403 forbidden error only on POST,PUT and delete

I have spring mvc(rest), spring security(4.x) and angular2 application. App is deployed in weblogic and it takes care of SAML authentication, so my app is just using authorization piece only. To do that we are using custom request header…
user509755
  • 2,941
  • 10
  • 48
  • 82
0
votes
1 answer

Return a 406 for a custom version mediatype in Spring Boot

I have a number of classes in Spring Boot (1.5.2) to enable versioning via a custom mediatype tag. The mediatype is in the format application/vnd..+json. ApiVersionedResource, @RequestMapping @Target({ElementType.METHOD,…
nixgadget
  • 6,983
  • 16
  • 70
  • 103
0
votes
1 answer

HTTP Post method returnin status code 404

My maven project using hibernate apache cxf spring and backbone.js I'm trying save data to table with post method.But I always get 404 as response code. my index.html code var departmentNameModel=Backbone.Model.extend({ …
0
votes
1 answer

Get null property when trying to use JSON views on rest Controller just extending from RestfulController

I'm trying out JSON views, not on top of domain class using @Resource, but by creating a RestfulController and trying to render that using JSON views. I've added all the relevant dependencies in build config. I have a domain Post class like this…
WILLIAM WOODMAN
  • 1,185
  • 5
  • 19
  • 36
0
votes
1 answer

Spring RestController url for findById and findByIds

In my Spring Boot application I have a following REST controller: @RestController @RequestMapping("/v1.0/decisions") public class CriterionController { @Autowired private CriterionService criterionService; @RequestMapping(value =…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
0
votes
1 answer

Integration test sleuth with restTemplate

I have a running code with spring boot and spring cloud using sleuth to log the TraceId. However i have problems in call one controller from other in the integrationTest public class TraceIdApp { @Bean public RestTemplate restTemplate()…
0
votes
1 answer

Set limits to Pageable on Spring Boot

I've got a @ResponseBody @Produces("application/json") @RequestMapping(value = "/users", method = RequestMethod.GET) public Page getRecentUsers(Pageable pageable, HttpServletResponse response){ return…
Jue Debutat
  • 367
  • 1
  • 3
  • 12
0
votes
2 answers

Using tomcat Can I check if my HTTP REQUEST is a valid Request to my web services?

Basically the TOMCAT response will be a "Bad Request 400" if I have any mistake in my REQUEST PARAMS, are there any solution to detect that mistake without writting a test code for the received REQUEST ?
0
votes
1 answer

Spring 4 RestController services not getting called from jsp in web application

I have developed a web-application using Spring4,maven,jquery,tomcat. I am using java config class instead of web.xml and spring applicationContext.xml. Using @RestController instead of @Controller in controller classes for decoupled application.…
0
votes
1 answer

Change response submitted from rest controller

I tried using filters and Interceptors to modify the response submitted from the controller method but i was unable to do as the response is committed before executing the filter or interceptor. I knew we have another option with ResponseBodyAdvice…
Nadendla
  • 712
  • 2
  • 7
  • 17
0
votes
0 answers

Creating controllers hierarchy with @RestController (spring boot application)

I want to create an hierarchy in my spring boot application controllers. Meaning: when requesting a path in one controller he will return the next controller. It doesn't work... In the example I created I expected to answer…
SharonBL
  • 1,735
  • 5
  • 20
  • 28
0
votes
1 answer

Who do the job of ViewResolver in Spring4 Rest Controller? & who render views after request?

Simple Controller & Tiles View Resolver => it works /** * For Exple: * Spring Controller * & Tiles View Resolver * It Works Well */ @Controller public class Home { @Autowired private IManager manager; public void…
Yugerten
  • 878
  • 1
  • 11
  • 30
0
votes
1 answer

getting error wrong month in Date while using Spring Rest Service

I am using spring rest services. I am getting wrong month when the json is parsed by Spring to : Fri Jan 13 05:30:00 IST 2017 from : Sat Jan 14 05:30:00 IST 2017 I am not even passing the time also time is not as my system clock. This is my…
kashif khan
  • 37
  • 1
  • 6
0
votes
2 answers

Spring Boot : Apache CXF SOAP with @RestController

I am making Spring Boot rest service using @RestController, in same project I am also exposing the Apache CXF SOAP service like @RestController Code @RestController @RequestMapping(value = "/mobileTopUpService") public class TopUpRestService…
Kashif Bashir
  • 81
  • 1
  • 6
0
votes
1 answer

springframework.data.mapping.PropertyReferenceException: No property merge found

I want to expose via spring rest the functionality to update an object. I am using Spring Data and I can't create "merge" functionality. I wrote bellow two options I tried so far with no success. controller: //this works @RequestMapping(method…