package controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class helloMVC {
@RequestMapping("/hello")
@ResponseBody
public String func1(String a){
System.out.println(a)
System.out.println("mod-controller-helloMVC-func1");
return "hello,MVC!123";
}
}
可以正常访问,a的值为null。
若把a定义为int型,报错如下
如把a定义为List,报错如下