Java tutorial
/* * Copyright baidu.com All right reserved. This software is the * confidential and proprietary information of baidu.com ("Confidential * Information"). You shall not disclose such Confidential Information and shall * use it only in accordance with the terms of the license agreement you entered * into with baidu.com. */ package com.freetest.test.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; /** * UserAction.java??TODO ?? * * @author free 2015925 ?4:05:57 */ @Controller //@RequestMapping(value = "/") public class HomeAction { @RequestMapping(value = "/", method = { RequestMethod.GET }) public ModelAndView index() { ModelAndView mav = new ModelAndView("index"); mav.addObject("user", "hello"); return mav; } }