I have written one controller class, in which i am writing one request mapping method which in turn will call another method with request mapping (but this time with some path variable)
Exception encountered:
java.lang.NumberFormatException: For input string: “{50}”
Controller class :
@Controller
public class CompanyController {
....other code.........
@RequestMapping("/companySave.do")
public String saveCompany(Map<String, Object> map, @ModelAttribute("company")
Company company, BindingResult result)
{
map.put("success", "success");
companyService.saveCompany(company);
return "redirect:/companyAddressSave/{"+company.getId()+"}.do";
}
@RequestMapping("/companyAddressSave/{id}.do")
public String saveAddressCompany(@PathVariable("id") String id,Map<String, Object> map, @ModelAttribute("company")
Company company, BindingResult result)
{ map.put("Success", "Success");
map.put("company", companyService.getCompany(Long.parseLong(id)));
System.out.println("Hi");
return "add-compnay-master";
}
}
can anybody tell me if i am doing any mistake while passing path variable..???
thanks in advance..!
Don’t pass along the curly braces: