RequestMapping似乎没有name参数吧,它是用来替代HandleMapping的,一般用于连接浏览器与服务器之间的路径,如@RequestMapping("/login.do")
有name参数的是Resource,像@Resource(name = "loginService")
这里的name参数是告诉服务器去读取有注解@Service("loginService")的class
抱歉,压根没听说name属性,常用value
/**
* Assign a name to this mapping.
*
Supported at the type level as well as at the method level!
* When used on both levels, a combined name is derived by concatenation
* with "#" as separator.
* @see org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder
* @see org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy
*/
String name() default "";
源代码上面的注释,name的作用就是一个命名