"redirect:/news/to"; springmvc的方式通過後臺來進行重定向目錄

瓜瓜東西發表於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";  
    }
}

相關文章