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

Unable to find rest resource using spring boot with angular

I have my simple project setup like this: angular-controller: myApp.controller('signupCtrl', function ($rootScope, $scope, auth) { "ngInject"; function successAuth(res) { console.log(res); } $scope.addUser = function () { …
kittu
  • 6,662
  • 21
  • 91
  • 185
0
votes
0 answers

Spring RestController ObjectMapper first request performance

I discovered that very first request to my restcontroller method take more time then others. I run JProfiler against my application and noticed that ObjectMapper is looking for deserializator in DeserializationContext class and when deserializator…
Damian0o
  • 653
  • 5
  • 15
0
votes
0 answers

Custom Exception handling in Rest client using Rest Template

I Did Custom Exception handling on server side using @ControllerAdvice and extending ResponseEntityExceptionHandler . I have a requirement to call the service from rest client using rest template. Rest template uses DefaultResponseErrorHandler class…
0
votes
1 answer

My angular frontend App can not send PUT request to my backend REST app

I have two web apps running on a single tomcat instance. One of them is Spring MVC Rest app which has basic structure, a rest controller, a service layer and DAO layer which is interacting with postgresql . Below you can see my…
0
votes
1 answer

How to pass filter params from angularjs to spring restcontroller with @MatrixVariable

I am not able to find a way to use angularjs's $http.get to pass filter params. Url is: http://localhost:8080/template/users/query;username=abcd;firstName=ding... RestController is: @RequestMapping(value={"/users/{query}"},…
SVGK Raju
  • 49
  • 6
0
votes
2 answers

How to deserialize JSON to model object with Spring's RestController

I'm developing a REST web application using Betfair's API, so I need to serialize/deserialize JSON in order to send HttpRequest and read HttpResponse. I'm using Spring MVC so I want to use Jackson with @RestController, @RequestBody and @ResponseBody…
andy
  • 269
  • 1
  • 12
  • 22
0
votes
3 answers

Got a 404 error on a simple rest service

i'm quite new to web developpement, I worked this summer on a web app on Spring, but the app was already set up, and was just doing some Java and AngularJS. But now i got some problem to start from scratch this type of application. I was trying to…
0
votes
1 answer

Caused by: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;II)V - in Spring REST example

I am working on Spring RESTFul resource example. I've taken a reference from the link : https://github.com/habuma/rest-books. In this example I only updated dependencies in the pom.xml shown below and rename the package name to make it more…
user4821194
0
votes
0 answers

Spring Controller / leading/trailing whitespaces in URL

I've a very simple Spring MVC application, for example: @Controller @RequestMapping("/rest") public class MyController { @RequestMapping(value = "/endpointA"} public @ResponseBody ResponseObject endpointA() { return something; …
Stefgo83
  • 51
  • 3
0
votes
1 answer

how to display model object in angular js?

Here is my RestController Class @RestController @RequestMapping(value="/user") public class Test { @RequestMapping(value="/{userEmailId}",method=RequestMethod.GET) public ModelAndView getUser(@PathVariable("userEmailId") String…
Anil
  • 191
  • 1
  • 2
  • 11
0
votes
1 answer

Why always redirected to the access denied page?

application POST submit doesn't enter to the spring REST controller. Instead of that request redirected to the access denied page according to "secure config" file mentioned. system allowed to the all request from any external parties via spring…
Sadun89
  • 144
  • 1
  • 2
  • 12
0
votes
0 answers

Order of fields getting changed in response JSON from a REST API

In my RestController I am returning a POJO which has a LinkedHashMap. public class ReportTypesVO { private LinkedHashMap reportTypes; public LinkedHashMap getReportTypes() { return…
smruti ranjan
  • 741
  • 2
  • 9
  • 23
0
votes
0 answers

Thymeleaf dynamic header and content table from database

I am new in thymeleaf. I have question about dynamic table. Here is my case : [ { "country":"country 1", "districs":[ { "district":"district 1", "cinemas":[ { …
Edi
  • 13
  • 6
0
votes
1 answer

Spring Boot + multipart/form-data controller method

Can't seem to figure this out, no matter what I try. I'm submitting this curl command: curl -v -F name=countries.zip -F filedata=@countries.zip http://localhost:8080/rest I have a Spring Boot 1.4 app with an annotated @RestController with the…
Bal
  • 2,027
  • 4
  • 25
  • 51
0
votes
1 answer

Spring boot Annotations keeps http data in the variables

I have a problem with spring boot. It's keeps data in a class that is annotated in: @RestController, @Service, @Component. I can't keep any data because it will be shared with others like a session. Example: @RestController public class controller…