Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value = "/home", method = RequestMethod.GET) public String home(Model model) {
- List<WarehouseItem> clients = clientService.getAllClients();
- ComboBoxProperties comboBoxProperties = new ComboBoxProperties();
- List<String> companies = new ArrayList<>();
- List<String[]> products = new ArrayList<>();
- for ( Map.Entry<String, String[]> set: comboBoxProperties.getKeyValuesParForCompaniesAndProducts()
- .entrySet() ) {
- companies.add(set.getKey());
- products.add(set.getValue());
- }
- model.addAttribute("myMap", comboBoxProperties.getKeyValuesParForCompaniesAndProducts());
- model.addAttribute("test", comboBoxProperties.getKeyValuesParForCompaniesAndProducts().keySet());
- model.addAttribute("companies", companies);
- model.addAttribute("products", products);
- model.addAttribute("warehouseItems", clients);
- model.addAttribute("warehouseItem", new WarehouseItem());
- return "home";
- }
- @RequestMapping(value = "/home", method = RequestMethod.POST)
- public ModelAndView somethingElse(@RequestBody String key, Model model) {
- ComboBoxProperties comboBoxProperties = new ComboBoxProperties();
- ArrayList<String> comp = new ArrayList<>(
- Arrays.asList(comboBoxProperties.getKeyValuesParForCompaniesAndProducts().get(key)));
- model.addAttribute("comp", comp);
- ModelAndView view = new ModelAndView();
- view.setViewName("home");
- return view;
- }
Advertisement
Add Comment
Please, Sign In to add comment