com.mycompany.warsztat.controller.HomeController.java Source code

Java tutorial

Introduction

Here is the source code for com.mycompany.warsztat.controller.HomeController.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.warsztat.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <h2> HomeController </h2>
 * It is used to show welcome page.
 * 
 * @author Nowik 
 * 
 */
@Controller
public class HomeController {

    /**
     * This metod return view to controller
     * 
     * @param model
     * @return "welcome" view
     */
    @RequestMapping("/")
    public String welcome(Model model) {
        model.addAttribute("greeting", "Witaj w aplikacji garaz");
        model.addAttribute("tagline", "Aplikacja jest kompleksowym narzdziem do obsugi warsztatu.");

        return "welcome";
    }
}