| 1234567891011121314151617181920212223242526272829303132 |
- package com.izouma.awesomeadmin.web;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.ResponseBody;
- import org.springframework.web.servlet.ModelAndView;
- import javax.servlet.http.HttpServletRequest;
- /**
- * 首页
- * Created by xiong on 2016/10/26.
- */
- @Controller
- public class MainController {
- // @RequestMapping(value = "/index", method = RequestMethod.GET)
- // @ResponseBody
- // public ModelAndView home() {
- // return new ModelAndView("redirect:/admin");
- // }
- @RequestMapping("/{viewName}")
- public ModelAndView index(HttpServletRequest request, @PathVariable("viewName") String viewName) {
- return new ModelAndView("html/" + viewName + ".html");
- }
- }
|