IndexController.java 919 Bytes
package com.glsx.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.ModelMap;
import com.glsx.config.SystemProperty;

/**
 * @author deployer name
 * @version V1.0
 * @Title: IndexController.java
 * @Description:
 * @Company: Didihu.com.cn
 * @Copyright Copyright (c) 2017
 */
@Controller
public class IndexController {

    @Autowired
    private SystemProperty systemProperty;

    @ResponseBody
    @RequestMapping("home")
    public String home() {
        return "hello, welcome to home!" + systemProperty.getName();
    }

    @RequestMapping("index")
    public String index(ModelMap map) {
        map.addAttribute("name", systemProperty.getName());
        return "index";
    }
}