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的名称规则类似

猜你喜欢

转载自www.cnblogs.com/batj/p/9198082.html
今日推荐