代码如下:
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* @author Administrator
*
*/
@Controller
@RequestMapping(value = "/home")
public class LocationRestfulController extends BaseController {
@RequestMapping(method = RequestMethod.GET)
public String go() {
// return "redirect:test"; // 访问http://localhost:8080/home会跳转到http://localhost:8080/test
// return "redirect:/test"; // 访问http://localhost:8080/home会跳转到http://localhost:8080/test
// return "redirect:home/test"; // 访问http://localhost:8080/home会跳转到http://localhost:8080/home/test
return "redirect:/home/test";// 访问http://localhost:8080/home会跳转到http://localhost:8080/home/test
}
}