@MatrixVariable(name=“userid”,pathVar=“username”) String userid){//pathVar是在当前目录下搞的}
name就是参数名字
pathVar 是在某个路径下访问,然后接收userid这个参数
如 访问
http://localhost:8080/SpringDemo_war_exploded/annodemo/hellomatrix/miao;userid=123
证明是在username下这个目录下,添加;userid= xxxx参数,然后@MatrixVariable访问userid
又如:
http://localhost:8080/SpringDemo_war_exploded/annodemo/hellomatrix;userid=123
什么这个就不是在username这个路径访问的userid这个参数是在hellomatrix访问的所以userid这个参数不会被@MatrixVarable接收.