From 01dddf49c0a2545f4477d8d220add3c5849e2fb0 Mon Sep 17 00:00:00 2001 From: ahmetcetin39 <30636222+ahmetcetin39@users.noreply.github.com> Date: Wed, 20 Sep 2017 16:54:10 +0300 Subject: [PATCH] BAEL-1088 / fix / RequestMapping is replaced with GetMapping (#2640) * RequestMapping is replaced with GetMapping * Update PassParametersController.java --- .../controller/PassParametersController.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-all/src/main/java/org/baeldung/controller/controller/PassParametersController.java b/spring-all/src/main/java/org/baeldung/controller/controller/PassParametersController.java index 54047cedf3..c282ae6a62 100644 --- a/spring-all/src/main/java/org/baeldung/controller/controller/PassParametersController.java +++ b/spring-all/src/main/java/org/baeldung/controller/controller/PassParametersController.java @@ -3,8 +3,7 @@ package org.baeldung.controller.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.servlet.ModelAndView; /** @@ -16,23 +15,23 @@ import org.springframework.web.servlet.ModelAndView; */ @Controller public class PassParametersController { - @RequestMapping(value = "/showViewPage", method = RequestMethod.GET) + @GetMapping("/showViewPage") public String passParametersWithModel(Model model) { model.addAttribute("message", "Baeldung"); return "viewPage"; } - @RequestMapping(value = "/printViewPage", method = RequestMethod.GET) + @GetMapping("/printViewPage") public String passParametersWithModelMap(ModelMap map) { map.addAttribute("welcomeMessage", "welcome"); map.addAttribute("message", "Baeldung"); return "viewPage"; } - @RequestMapping(value = "/goToViewPage", method = RequestMethod.GET) + @GetMapping("/goToViewPage") public ModelAndView passParametersWithModelAndView() { ModelAndView modelAndView = new ModelAndView("viewPage"); modelAndView.addObject("message", "Baeldung"); return modelAndView; } -} \ No newline at end of file +}