SpringMvc中@PathVariable注解简单的用法
@PathVariable
/**
	 * @PathVariable 可以来映射 URL 中的占位符到目标方法的参数中.
	 * @param id
	 * @return
	 */
jsp页面请求
<a href="springmvc/testPathVariable/1">Test PathVariable</a>
Action中方法
@RequestMapping("/testPathVariable/{id}")
	public String testPathVariable(@PathVariable("id") Integer id) {
		System.out.println("testPathVariable: " + id);
		return SUCCESS;
	}

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号