Java tutorial
/* This file is part of Composer. Composer is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Composer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Composer. If not, see <http://www.gnu.org/licenses/>. Copyright 2016 (C) Viktor Nareiko */ package com.github.viktornar.controller; import com.github.viktornar.model.Atlas; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * Main page controller. Will be displayed by default. * * @author v.nareiko */ @Controller @RequestMapping("/") public class IndexController { @RequestMapping(method = RequestMethod.GET) public String getIndex(ModelMap model) { model.addAttribute("atlas", new Atlas()); return "index"; } }