org.zhangmz.pickles.controller.IndexController.java Source code

Java tutorial

Introduction

Here is the source code for org.zhangmz.pickles.controller.IndexController.java

Source

/*******************************************************************************
 * Copyright (c) 2015, 2016  104446930@qq.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package org.zhangmz.pickles.controller;

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;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

/**
 * Title:IndexController.java
 * Description:
 * Company: DigitalChina 2016
 * @author:
 * @date:2016125 ?11:08:36
 * 
 */

@Controller
@EnableWebMvc
@RequestMapping("/")
public class IndexController {

    @RequestMapping
    String home() {
        return "redirect:/index";
    }

    @RequestMapping(value = "index", method = RequestMethod.GET)
    public ModelAndView index() {
        ModelAndView result = new ModelAndView("index");
        return result;
    }
}