package p.idzik2.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; /** * Created by operator on 31.01.2017. */ @Controller public class HelloController { //@ResponseBody @GetMapping("/") public String hello(ModelMap modelMap){ modelMap.addAttribute("text","hello"); return "hello"; } @GetMapping("/if") public String ifMethod(ModelMap modelMap){ modelMap.addAttribute("text","Sample text"); modelMap.addAttribute("a",123); modelMap.addAttribute("b",10); return "if"; } }