BAEL-1088 / fix / RequestMapping is replaced with GetMapping (#2640)
* RequestMapping is replaced with GetMapping * Update PassParametersController.java
This commit is contained in:
parent
771ded6b03
commit
01dddf49c0
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user