HomeController.java I have web page which loads the pages dynamically. My first Mapping method loads the appropriate pages as per the product choosed. I hav a menu in each product page and I need the second mapping method to execute. But it always executes the first one. What should I do to execute the second one?
@RequestMapping("/page/{pagename}")
public ModelAndView loadProductPage(ModelMap model, @PathVariable("pagename") String pagename) {
System.out.println("Load Product Page");
model.addAttribute("productname",pagename);
return new ModelAndView("products/"+pagename+"/"+pagename);
}
@RequestMapping("/page/loadpage/{choosedProduct}/{linkChoosed}")
public ModelAndView loadProductMenuPages(ModelMap model, @PathVariable("linkChoosed") String linkChoosed, @PathVariable("choosedProduct") String choosedProduct) {
System.out.println("Product Choosed" + choosedProduct);
System.out.println("Link Choosed" + linkChoosed);
return new ModelAndView("products/"+choosedProduct+"/"+linkChoosed);
}