spring mvc matrixVariable 获取不到值
今天看spring mvc 根据文档上面写的Matrix Variables 时获取不到值
package com.ccc.helloworld.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.MatrixVariable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HelloWorldController {
@RequestMapping(value = "/{petId}")
public String findPet(@PathVariable("petId") String petId,
@MatrixVariable String q) {
System.out.println(petId);
System.out.println(q);
return "../index.jsp";
}
}
浏览器输入:http://localhost:8080/springmvc_0100_helloworld/hello/fn;q=1
控制台输出:fn null
为什么q的值获取不到啊 而且就算设置 defaultValue 还是null
求解答
补充:Java , Java EE