spring mvc:练习 @RequestParam(参数绑定到控制器)和@PathVariable(参数绑定到url模板变量)
spring mvc:练习 @RequestParam和@PathVariable @RequestParam: 注解将请求参数绑定到你的控制器方法参数 @PathVariable: 注释将一个方法参数绑定到一个URI模板变量的值 @RequestParam: 注解将请求参数绑定到你的控制器方法参数 @RequestMapping(value="/example/user") public String UserInfo(Model model, @RequestParam(value="name", defaultValue="Guest") String name) 实例: package springmvc; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller public class RequestParamExampleController { @RequestMapping