Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

more parameters java sql @PathVariable

@GetMapping("/api/employeeswithmapvariable/{id}/{name}")
@ResponseBody
public String getEmployeesByIdAndNameWithMapVariable(@PathVariable Map<String, String> pathVarsMap) {
    String id = pathVarsMap.get("id");
    String name = pathVarsMap.get("name");
    if (id != null && name != null) {
        return "ID: " + id + ", name: " + name;
    } else {
        return "Missing Parameters";
    }
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #parameters #java #sql
ADD COMMENT
Topic
Name
6+3 =