SpringMVC中@RequestMapping

@Controller
@RequestMapping("/zhangpn")
public class Hello {
    @RequestMapping("/hello")
    public String Hello() {
        System.out.println("**************hello*******************");
        return "success";
    }
}

访问路径url应为http://localhost:8080/SpringMVC/zhangpn/hello

与struts2中的包的命名空间和action的名称规则类似

posted @ 2018-06-19 12:52  呦,可以呦  阅读(100)  评论(0编辑  收藏  举报