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
2 answers

why Spring 3.x path param is truncated

The path param value is truncated randomly. ex : myapplication/{pathparam} Actual value "ab-cd-626-1.2.3.4 .6" is actually parsed as ab-cd-626-1.2.3.4. No idea why this is happening, please help
0
votes
0 answers

Not able to get AngularJs fileData from HttpServletRequest at server side

AngularJS Client Side: userTab.factory('someService', ['apiService','$rootScope', function(apiService, $rootScope){ return { updateData : function (someObj){ return apiService.request({ apiMethod:…
sjain
  • 23,126
  • 28
  • 107
  • 185
0
votes
0 answers

Filter Json response - Spring rest services

I have created rest services using Spring MVC framework & in back end am using hibernate objects to fetch the data from the DB. I am directly exposing the hibernate objects through the rest service response as it is. But now i want to filter/dont…
0
votes
1 answer

How to return the JSON representation of an object through a RESTful spring application?

I'm targeting Spring version 4.2. So after reading some pages of the reference documentation, I developed this application. This application has only one method. This method should be able to return a JSON representation of a very simple java…
0
votes
0 answers

How to Post Form class object back using Angularjs to Spring RestController

I'm blocked trying to post back to Rest Controller using AngularJS. What's the way to retrieve the MyCommand Class Object ? Do I have to convert it in some way back to an object ? I see it done successfully the way I'm trying in examples but it…
JohnnyO
  • 527
  • 9
  • 21
0
votes
1 answer

Use Field Formatter in Spring RestControllers

I try to make a RestController use my custom formatter for a java.time.Duration, but I am not successful not knowing why. I have a simple Order entity, a OrderController and a DurationFormatter that should be applied for the conversion of the…
Gregor
  • 2,917
  • 5
  • 28
  • 50
0
votes
0 answers

Spring Controller Method annotated with @ResponseBody, @GET takes long time to generate respone

Spring Controller Method annotated with @ResponseBody takes long time to generate JSON response when I annotate it with @GET HTTP Method annotation While the same method when annotated with @POST (keeping @ResponseBody annotation intact), the JSON…
Amit Dube
  • 947
  • 4
  • 10
  • 23
0
votes
1 answer

no suitable HttpMessageConverter found for response type [class com.avada.rest.UsersController$Users]

I am getting the following exception and not sure why... Exception in thread "main" org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class…
Zack Macomber
  • 6,682
  • 14
  • 57
  • 104
0
votes
1 answer

@restcontroller and @responsebody not working in Spring MVC + Thymeleaf

In my spring MVC 4.1.5 application configured to use Thymeleaf 2.1.4 (before it was using JSP and it worked fine), i am unable to return a JSON response. It always returns a full HTML page weather my request mapping is in a @RestController or if…
0
votes
0 answers

Spring Servlet dispatcher not returning result for API calls but jsp renders fine

I have been facing an issue with exposing the REST Api using Spring REST. The api call reaches the invocation handler and properly identifies the method and beans. But there is no further execution after the target method is invoked 2016-01-23…
iDroid
  • 1,140
  • 1
  • 13
  • 30
0
votes
1 answer

Property reference exception with jpa

I am new to spring data jpa and trying to use it but facing an issue with org.springframework.data.mapping.PropertyReferenceException: No property name found for type User! Could some one suggest me what can be done ? I am struggling but could…
0
votes
1 answer

@RestController cannot convert from ResponseEntity

I've got following code for my REST Controller: @RequestMapping(value = "foo", method = RequestMethod.GET) public ResponseEntity doSomething(@RequestParam int someParam) { try { final Result result =…
tillias
  • 1,035
  • 2
  • 12
  • 30
0
votes
1 answer

Spring webAppContextSetup does not recognize controllers mappings

My unit test fails when testing a controller. I am getting a 404 when expecting a 200 status code. I suppose the webAppContextSetup does not recognize controllers. Here is my…
cosmind
  • 21
  • 4
0
votes
1 answer

Spring Restful service is only returning English characters but other characters except English is displayed as '?'

I have built a Restful web service using Spring MVC 4.0.1. The controller is returning response of every English words and characters in a browser. But every individual character that are NON-ENGLISH are being returned as ?. For e.g. for नेपाल…
Mubin Shrestha
  • 398
  • 3
  • 22