Questions tagged [get-mapping]

67 questions
1
vote
3 answers

How to make Get Request with Request param in Postman

I have created an endpoint that accepts a string in its request param @GetMapping(value = "/validate") private void validateExpression(@RequestParam(value = "expression") String expression) { System.out.println(expression); //…
1
vote
1 answer

Deserialize Params into object

I have a URL abc.com/loc/lat=90.6&long=44.6&sf='random' here lat and long are required and sf is an optional param. I have created a class with these three as data members, how can I deserialize those params into that class object?
1
vote
1 answer

Spring MVC @GetMapping @ModelAttribute percent(%) symbol gives null value

Here is my controller: @CrossOrigin(origins = "http://localhost:3000") @RestController @RequestMapping("/api/v1/employees") public class EmployeeController { @Autowired private EmployeeService employeeService; @GetMapping() public…
1
vote
1 answer

Build Complex JSON payload from java classes

I would like to create following json payload from the java classes. Only one condition is there, Subgroup1 can be null, meaning group may/may not have subgroup1. Not sure how can it be done. Any help would be highly appreciated. Thanks in advance!…
Divya
  • 13
  • 1
  • 5
1
vote
1 answer

Controller not processing Path Variable correctly - Spring boot

I have a list of customers who have some orders and I display them all in a table. I have added a button in order to delete each order if desired. This is the table of how I display them. …
user1234567
  • 37
  • 1
  • 10
1
vote
1 answer

Make a vector of coordinates to filter data within a certain area

Rookie R user here and I would greatly appreciate any help you someone could give me. My project requires me to create a vector boundary box around a city of my choice and then filter a lot of data so I only have the data relative to the area.…
T.Omalley
  • 325
  • 1
  • 2
  • 9
1
vote
4 answers

Spring @GetMapping is being ignored

I have the following controller: @RestController @RequestMapping("/api/{brand}") public class CarController { private final CarService carService; @Autowird public CarController(CarService carService) { this.carService = carService; …
Titulum
  • 9,928
  • 11
  • 41
  • 79
1
vote
1 answer

How to return object for GetMapping path id

The controller code : @GetMapping("/show/{id}") public ResponseEntity findId(@PathVariable Student student) throws Exception { Student showId = studentService.findId(student); return new ResponseEntity(showId,…
Thammaphon
  • 51
  • 1
  • 3
1
vote
1 answer

@PathVariable of GetMapping in Spring throws an error when the input is #

I have made an autosuggest input field that automatically searches the database on every keypress. It works fine when i insert regular characters like letters and numbers but it gets spooky when you try start the search request with the character #.…
Maurice
  • 6,698
  • 9
  • 47
  • 104
1
vote
0 answers

Calling @GetMapping "/" on external tomcat throws error - Spring Boot

I developed a spring boot application and deployed on external tomcat. What I am facing is when I call application through context path tomcat throws an exception. Controller @GetMapping(value="/", produces = "text/html;charset=UTF-8") public…
sadia
  • 305
  • 1
  • 7
  • 18
1
vote
0 answers

Can we use deserializer for getmapping in spring boot which has pojo similar to @beanparam of jersey

I have a spring boot app where I am planning to write an API which is a GET request but has many request parameters in it. So I have created a POJO which maps the request params to the POJO. I wanted to deserialize it before mapping the request…
1
vote
1 answer

SQLGrammarException with native Query in spring boot

I tried to run a GettMapping with Postman. But it's not working and I am getting the error: Status 500 error. SQLGrammarException: could not extract ResultSet @GetMapping("/clients/month/{month}") public Meter getAllMeterByMonth(@PathVariable…
1
vote
2 answers

Inside @GetMapping mapped method is it possible to fetch relative URL defined in value attribute

In Spring web service, I have controller having multiple URL mapped method to handle requests. I want to map 2 urls to a single @GetMapping method like below: @GetMapping(value = {"ex/{status}", "ex/retries/{status}"}, produces =…
nanosoft
  • 2,913
  • 4
  • 41
  • 61
1
vote
1 answer

Spring Unit testing rest controller

What is the best and easiest solution to test these sample get mappings? Could you show some easy example? @GetMapping("/") public List get() { return userService.getUsers().stream().map((User user) ->…
rmitula
  • 47
  • 2
  • 6
1
vote
1 answer

GetMapping in Spring boot to exclude specific path variable match

I have a controller with the following GetMapping @GetMapping(value = "/dawson/v1/{dataType}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity respondWithData(@PathVariable String dataType, @RequestParam(name =…
DPancs
  • 588
  • 6
  • 14