idzik icon

Java-Spring1

idzik | PRO | 02/01/17 04:45:28 PM UTC | 0 ⭐ | 367 👁️ | Never ⏰ | []
Java |

740 B

|

None

|

0 👍

/

0 👎

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";
    }
 
 
}

Comments