實現springmvc 的controller級別的跳轉的方法 return "redirect:/news/to";

瓜瓜東西發表於2014-06-09
package com.wanju.project001.zonghe.common.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
@RequestMapping("/news")
public class TestJavaRedirectController {


    @RequestMapping("/to")
    public String redirectTo()
    {
        System.out.println("self-test");
        return "redirect:/news/to";  
    }
}

相關文章