很好奇@RestController的参数是干嘛的,就是这个abcd是什么东西,有什么用处,有什么效果??百度不到啊
Bean 的名称,如果你写了 bean 的名称就是你指定的,如果你没有写那么 Spring 会帮你生成。其实和 @Controller、@Service、@Component 的 value 是一样的
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Controller
@ResponseBody
public @interface RestController {
/**
* The value may indicate a suggestion for a logical component name,
* to be turned into a Spring bean in case of an autodetected component.
* @return the suggested component name, if any (or empty String otherwise)
* @since 4.0.1
*/
String value() default "";
}
指定bean名称
只要你点进去看看RestController,就不会这么问了 - -