单位门户网站建设的请示,拓和科技有限公司网站,制作网页的软件免费,新手如何搭建网站spring中有时候一个类上面标记很多注解。实际上Java注解可以进行继承(也就是把多个注解合并成1个)比如说SpringMVC的注解RestControllerRequestMapping(/person)可以合并为一个PathRestController(/user)实现是#xff1a;import java.lang.annotatio…spring中有时候一个类上面标记很多注解。实际上Java注解可以进行继承(也就是把多个注解合并成1个)比如说SpringMVC的注解RestControllerRequestMapping(/person)可以合并为一个PathRestController(/user)实现是import java.lang.annotation.Documented;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;import org.springframework.core.annotation.AliasFor;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;Target(ElementType.TYPE)Retention(RetentionPolicy.RUNTIME)DocumentedRestControllerRequestMappingpublic interface PathRestController {AliasFor(path)String[] value() default {};AliasFor(value)String[] path() default {};}