页面跳转restful风格
通过RequestMapping在url中写地址,可以实现通用页面跳转
package com.test.tt;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/")
@Controller
public class PageController {
@RequestMapping("test/{page}")
public String intoPage(@PathVariable String page) {
return page;
}
}