List of usage examples for org.springframework.ui Model containsAttribute
boolean containsAttribute(String attributeName);
From source file:it.polimi.diceH2020.launcher.controller.view.MainFlowController.java
@RequestMapping(value = "/", method = RequestMethod.GET) public String showHome(SessionStatus sessionStatus, Model model) { if (model.containsAttribute("sim_manager")) { sessionStatus.isComplete();// w w w . jav a 2 s.c om } model.addAttribute("wsStatusMap", ds.getWsStatus()); model.addAttribute("queueSize", ds.getQueueSize()); model.addAttribute("privateQueueSize", ds.getPrivateQueueSize()); List<String> descriptions = new ArrayList<>(); descriptions.add("Private cloud with Admission Control"); descriptions.add("Private cloud without Admission Control"); descriptions.add("Public cloud with Complex Pricing Model"); descriptions.add("Public cloud without Complex Pricing Model"); model.addAttribute("descriptions", descriptions); return "home"; }
From source file:es.ucm.fdi.dalgs.topic.web.TopicController.java
/** * methods for adding topics/*w w w. j a va 2 s . c o m*/ */ @RequestMapping(value = "/degree/{degreeId}/module/{moduleId}/topic/add.htm", method = RequestMethod.GET) public String addTopicGET(Model model, @PathVariable("degreeId") Long id_degree) { if (!model.containsAttribute("topic")) model.addAttribute("topic", new Topic()); model.addAttribute("valueButton", "Add"); model.addAttribute("typeform", "form.add"); return "topic/form"; }
From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java
@RequestMapping(value = "/launch2", method = RequestMethod.GET) public String launchWithMultipleJson(@RequestParam("scenario") String scenario, SessionStatus sessionStatus, Model model) { if (model.containsAttribute("sim_manager")) { sessionStatus.isComplete();//w w w .j a v a2 s .c o m } model.addAttribute("scenario", Scenarios.valueOf(scenario)); //model.addAttribute("activeJson", FileService.activeJson(Scenarios.valueOf(scenario))); return "launchSimulation_FileUploadWithMultipleJson"; }
From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java
@RequestMapping(value = "/launchRetry", method = RequestMethod.GET) public String launch(@RequestParam("scenario") String scenario, @RequestParam("message") String message, SessionStatus sessionStatus, Model model) { if (model.containsAttribute("sim_manager")) { sessionStatus.isComplete();//from w ww .ja v a 2 s . com } List<Scenarios> privateScenariosModels = new ArrayList<Scenarios>(); privateScenariosModels.add(Scenarios.PrivateAdmissionControl); privateScenariosModels.add(Scenarios.PrivateAdmissionControlWithPhysicalAssignment); model.addAttribute("scenario", Scenarios.valueOf(scenario)); model.addAttribute("Scenarios", privateScenariosModels); model.addAttribute("message", message); return "launchSimulation_FileUpload"; }
From source file:com.epam.cme.storefront.controllers.pages.AbstractPageController.java
protected String getViewForPage(final Model model) { if (model.containsAttribute(CMS_PAGE_MODEL)) { final AbstractPageModel page = (AbstractPageModel) model.asMap().get(CMS_PAGE_MODEL); if (page != null) { return getViewForPage(page); }// ww w. ja v a 2s .c om } return null; }
From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java
@RequestMapping(value = "/", method = RequestMethod.GET) public String showHome(SessionStatus sessionStatus, Model model) { if (model.containsAttribute("sim_manager")) { sessionStatus.isComplete();/*from w ww . j a v a2s . c o m*/ } model.addAttribute("wsStatusMap", ds.getWsStatus()); model.addAttribute("queueSize", ds.getQueueSize()); model.addAttribute("privateQueueSize", ds.getPrivateQueueSize()); Map<Integer, Scenarios> scenarios = new HashMap<>(); scenarios.put(0, Scenarios.PrivateAdmissionControl); scenarios.put(1, Scenarios.PrivateNoAdmissionControl); scenarios.put(2, Scenarios.PublicPeakWorkload); scenarios.put(3, Scenarios.PublicAvgWorkLoad); model.addAttribute("scenarios", scenarios); return "home"; }
From source file:it.polimi.diceH2020.launcher.controller.view.MainFlowController.java
@RequestMapping(value = "/launch", method = RequestMethod.GET) public String launch(@RequestParam("cloudType") String cloudType, @RequestParam("useComplexPricingModel") String useComplexPricingModel, @RequestParam("admissionControl") String admissionControl, SessionStatus sessionStatus, Model model) { if (model.containsAttribute("sim_manager")) { sessionStatus.isComplete();//w ww . ja v a 2 s . c om } model.addAttribute("cloudType", cloudType); model.addAttribute("useComplexPricingModel", useComplexPricingModel); model.addAttribute("admissionControl", admissionControl); List<Scenario> scenarios = new ArrayList<>(); switch (CloudType.valueOf(cloudType)) { case PRIVATE: scenarios.add( new Scenario(Technology.SPARK, CloudType.PRIVATE, null, Boolean.valueOf(admissionControl))); scenarios.add( new Scenario(Technology.HADOOP, CloudType.PRIVATE, null, Boolean.valueOf(admissionControl))); break; case PUBLIC: scenarios.add(new Scenario(Technology.SPARK, CloudType.PUBLIC, Boolean.valueOf(useComplexPricingModel), null)); scenarios.add(new Scenario(Technology.HADOOP, CloudType.PUBLIC, Boolean.valueOf(useComplexPricingModel), null)); scenarios.add(new Scenario(Technology.STORM, CloudType.PUBLIC, Boolean.valueOf(useComplexPricingModel), null)); break; default: throw new RuntimeException("Unknown type of cloud"); } model.addAttribute("scenarios", scenarios); return "fileUpload"; }
From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java
@RequestMapping(value = "/launch", method = RequestMethod.GET) public String launch(@RequestParam("scenario") String scenario, SessionStatus sessionStatus, Model model) { if (model.containsAttribute("sim_manager")) { sessionStatus.isComplete();/*from ww w .ja va2s . c om*/ } model.addAttribute("scenario", Scenarios.valueOf(scenario)); List<Scenarios> privateScenariosModels = new ArrayList<>(); privateScenariosModels.add(Scenarios.PrivateAdmissionControl); privateScenariosModels.add(Scenarios.PrivateAdmissionControlWithPhysicalAssignment); model.addAttribute("Scenarios", privateScenariosModels); List<Scenarios> publicScenariosModels = new ArrayList<>(); publicScenariosModels.add(Scenarios.PublicAvgWorkLoad); publicScenariosModels.add(Scenarios.StormPublicAvgWorkLoad); model.addAttribute("PublicScenarios", publicScenariosModels); return "launchSimulation_FileUpload"; }
From source file:es.ucm.fdi.dalgs.competence.web.CompetenceController.java
@RequestMapping(value = "/degree/{degreeId}/competence/{competenceId}/modify.htm", method = RequestMethod.GET) protected String modifyCompetenceGET(@PathVariable("degreeId") Long id_degree, @PathVariable("competenceId") Long id_competence, Model model) throws ServletException { if (!model.containsAttribute("competence")) { Competence p = serviceCompetence.getCompetence(id_competence, id_degree).getSingleElement(); model.addAttribute("competence", p); }//from ww w . j av a 2 s .c om model.addAttribute("valueButton", "Modify"); model.addAttribute("typeform", "form.modify"); return "/competence/form"; }
From source file:org.iti.agrimarket.view.UpdateOfferController.java
@RequestMapping(value = { "/updateoffer.htm" }, method = RequestMethod.GET) public String drawAddOfferPage(@RequestParam("offerId") int offerId, Locale locale, Model model) { locale = LocaleContextHolder.getLocale(); if (!model.containsAttribute("user")) { //model.addAttribute("user", user); System.out.println("------------------------"); System.out.println("-----!model view ----------"); // return new ModelAndView("signup"); return "redirect:/web/signup.htm"; }/*from ww w . j a v a 2 s .c o m*/ // if (!model.containsAttribute("offerId")) { // // //return new ModelAndView("offers_page"); // return "redirect:/offers.htm"; // // } List<Unit> units; units = unitService.getAllUnits(); System.out.println(units.get(1).getNameEn()); model.addAttribute("units", units); String[] countryArr = { "Ad Daqahliyah", "Al Bahr al Ahmar", "Al Buhayrah", "Al Fayyum", "Al Gharbiyah", "Al Iskandariyah", "Al Isma'iliyah", "Al Jizah", "Al Minufiyah", "Al Minya", "Al Qahirah", "Al Qalyubiyah", "Al Wadi al Jadid", "As Suways", "Ash Sharqiyah", "Aswan", "Asyut", "Bani Suwayf", "Bur Sa'id", "Dumyat", "Janub Sina", "Kafr ash Shaykh", "Matruh", "Qina", "Shamal Sina", "Suhaj" }; String[] countryArrAr = { "", "", "", "?", "", "", "", "", "?", "", "", " ", "", "", "", "", " ?", "", "", " ", "? ", "", "", " ", "" }; if (offerId == 0) { return "profile"; } model.addAttribute("states_ar", countryArrAr); model.addAttribute("states_us", countryArr); UserOfferProductFixed userOfferProductFixed = offerService.findUserOfferProductFixed(offerId); // offerIdVal=offerKey; List<Product> products = productService.getAllProducts(); System.out.println(products.get(1).getNameEn()); model.addAttribute("products", products); model.addAttribute("offer", userOfferProductFixed); System.out.println("hello################ new offer"); model.addAttribute("lang", locale); return "updateoffer"; }