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

call rest service with spring boot

I have a system who use spring boot. it use rest. I try to call one of the service of this system with this code public static void main(String[] args) { int timeout = 10000; final RequestConfig config =…
Yvan Dupré
  • 51
  • 2
  • 10
0
votes
1 answer

Auditing the userids ,services in restfull webservices

In our application we have couple of webservices.i need to get the userids(means who has loged in and webservice name) for auditing purpose i need to store. Could anyone suggest which will be either filter chain or Interceptors and how to get the…
Mahesh
  • 75
  • 1
  • 6
0
votes
1 answer

How to pass string array to a @PathVariable in Java springs

I have below API to be tested. Not getting solution to pass string array to requestors. Tried with comma seperated values, values with in [] etc. @RequestMapping(value = "/v10/{user}/alerts/alertguids/{requestors}", method = RequestMethod.GET) …
Rajesh Bhat
  • 791
  • 3
  • 8
  • 20
0
votes
1 answer

getting mapMappableContainerException while calling the rst service from postman

com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container java.lang.TypeNotPresentException: Type com.Mybean.class not…
RAJ
  • 31
  • 1
  • 1
  • 7
0
votes
0 answers

Jboss Spring rest Controller and angular2 error parsing

jboss EAP + spring rest controller My problem is with error response, even though i am throwing exception with error msg client receives html error page from jboss. which do not have my error msg.. so my code fails to parse the error and in result i…
d-man
  • 57,473
  • 85
  • 212
  • 296
0
votes
1 answer

Spring restful error 406

I have 406 error while using spring restful, I have already tried most answers, but for some reason, nothing works for me Here are my configuration: web.xml QndA Hub rest
Mark T
  • 773
  • 4
  • 10
  • 22
0
votes
2 answers

How to download excel using Angular JS

My Java REST service(POST call) is providing an excel file as response using hssfWorkbook and returning excel in xls format. response.getOutputStream(); hssfWorkbook.write(out); I have tried Filesaver but it will work for JSON as reponse. I didn't…
0
votes
1 answer

Spring Multiple HttpSecurity with Multiple dispatcher servlets

I have multiple HttpSecurity instances one for RESTFul api URL’s that start with /api/ and one for form based login. I also have 2 dispatcher one for normal request and other for rest API call. But do I need two ? @Bean public…
Mukun
  • 1,756
  • 10
  • 30
  • 57
0
votes
1 answer

Error managment in ControllerAdvice lead to duplication in URI and 404

I have a simple rest controller : @RestController @RequestMapping("/api/v1/") public class OrderController { @RequestMapping(value = "/orders2", method = RequestMethod.POST) public OrderDto createOrder2(@RequestBody OrderDto order) throws…
wishper
  • 615
  • 6
  • 18
0
votes
1 answer

Unexpected token u in JSON at position 0 angular spring

Unable to figure out why this error. I am not using any JSON.parse() which is the likely cause for this error to occur from most of the posts I have seen. I am using simple user-registration in angular: $scope.addUser = function () { …
kittu
  • 6,662
  • 21
  • 91
  • 185
0
votes
1 answer

Spring MVC REST return JSON response as ZIP

Have the following Spring REST code which returns a JSON response- @RequestMapping(value="/viewAllEmployees.do") @ResponseBody public List viewAllItems() { List allEmployees = employeeService.getAllEmployees(); …
user5591691
0
votes
2 answers

spring rest access in outside of application without login

I have one application using spring 4 and all the methods are rest(using RestController). I used spring-security(role based) for login and authentication url. Below is my spring-security.xml
0
votes
0 answers

Spring 3 RequestMapping - match the rest of the path with option of specific reserved end paths

Title might be confusing but essentially what I'm trying to do is explained below. If I had a url /app/{var1}/foo for a given class controller And now at this point I'd like to be able to have a single method that matches: /bar/bar1/bar2 (where…
user1111871
  • 137
  • 1
  • 12
0
votes
1 answer

why do i get $http.put().error function displaying

Angular js code $scope.removeItemFromCart = function (productId) { $http.put("removeItem/"+productId).success(function() { alert("Item Removed"); $scope.refreshCartItems(); }).error(function(){ alert("Error"); …
0
votes
1 answer

How websphere manages connection pool through datasource for multiple requests

I have a spring rest api which is hosted on websphere application server 8.5. which uses datasource to connect to the database and store the values The api handles around 10000 concurrent requests. What i really want to know if the maximum…