@Scope("session") @RequestMapping(value = "/add_customer", method = RequestMethod.POST) public String addCustomer(Locale locale, Model model, HttpServletRequest request) { try { /**/ ApplicationContext context = new ClassPathXmlApplicationContext("Spring-Module.xml"); CustomerDAO customerDAO = (CustomerDAO) context.getBean("customerDAO"); int ID = 0; String name = request.getParameter("name").toString(); int age = Integer.parseInt(request.getParameter("age")); String industry = request.getParameter("industry").toString(); String LastName = request.getParameter("LastName").toString(); String Gender = request.getParameter("Gender").toString(); String Phone = request.getParameter("Phone").toString(); String Email = request.getParameter("Email").toString(); String Country = request.getParameter("Country").toString(); String City = request.getParameter("City").toString(); String Experience = request.getParameter("Experience").toString(); String Education = request.getParameter("Education").toString(); HashMap<String, String> HashMap = new HashMap<String, String>(); HashMap.put("ID", Integer.toString(ID)); HashMap.put("Name", name); HashMap.put("Age", Integer.toString(age)); HashMap.put("Industry", industry); HashMap.put("LastName", LastName); HashMap.put("Gender", Gender); HashMap.put("Phone", Phone); HashMap.put("Email", Email); HashMap.put("Country", Country); HashMap.put("City", City); HashMap.put("Experience", Experience); HashMap.put("Education", Education); customerDAO.insert(HashMap); } catch (Throwable q) { } return "redirect:/humans"; }