Q:

How to extend Spring MVC Controller Annotation?

I want the code like this can be woking. How can I do?
@Target(value=ElementType.TYPE)
@Retention(value=RetentionPolicy.RUNTIME)
@Controller
@RequestMapping(value=RSI.DEFAULT_MAPPING + mapping())
public @interface RSI {
  public final static String DEFAULT_MAPPING = "/RSI";
  public String mapping() default "";
}

@RSI(mapping="/XXX")
public class XXXRSI {

A:

Spring uses a number of classes (as beans registered in your MVC configuration) for registering and handling the handler methods you declare in a @Controller class. The two main classes you should look at are RequestMappingHandlerMapping and RequestMappingHandlerAdapter. 
They have no built in way to do what you are suggesting. You'd have to extend those types (or write new ones with the appropriate interfaces) and register them instead of the ones above. This is not a trivial task.

