我想为每个用户设置自己的个人资料链接。
像这样:
@RequestMapping(value = "/{userlogin}", method = RequestMethod.GET)
public String page(@PathVariable("userlogin") String userlogin, ModelMap model) {
System.out.println(userlogin);
return "user";
}
但是静态页面也有这个表达式。
像这样:
@RequestMapping(value = "/hello", method = RequestMethod.GET)
public String hello() {
System.out.println("hello mapping");
return "hello";
}
那是当我请求调用两个控制器的 GET 请求“hello”时。
我想这样做,只有在未调用其他方法时才调用用户控制器。
控制台,当我调用localhost:8080/123 时:
123
控制台,当我调用localhost:8080/hello 时:
hello
hello mapping
或者
hello mapping
hello
我只想得到
hello mapping
当调用localhost:8080/hello
谁知道如何实现?