net.mamian.mySpringboot.controllers.HomeController.java Source code

Java tutorial

Introduction

Here is the source code for net.mamian.mySpringboot.controllers.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 net.mamian.mySpringboot.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * api?
 *
 * @author mamian
 * @mail mamianskyma@aliyun.com
 * @date 2016-07-05 11:45
 * @copyright 2016 ? All Rights Reserved
 */
@Controller
public class HomeController {

    /**
     * 
     * 
     * @return 
     */
    @RequestMapping("/")
    public ModelAndView index() {
        return new ModelAndView("index");
    }

    /**
     * 1?jsp?
     * 
     * @return 
     */
    @RequestMapping("/forward1")
    public String forward1() {
        return "user/profile";
    }

    /**
     * 2?jsp?
     * 
     * @return 
     */
    @RequestMapping(value = "forward2", method = RequestMethod.GET)
    public ModelAndView forward2() {
        return new ModelAndView("user/profile");
    }

}