This is my controller:
@Controller
@RequestMapping("/test")
public class TestServlet {
@RequestMapping("/country/{latitude}-{longitude}")
public String getCountry(@PathVariable String latitude, @PathVariable String longitude, Model model){
//inject the data in the JSP
model.addAttribute("latitude", latitude);
model.addAttribute("longitude", longitude);
//return the html
return "private/private";
}
I want to know how to access this method with parameter from javascript code.
public String getCountry(@PathVariable String latitude, @PathVariable String longitude, Model model);