Q:

Spring MVC: get RequestMapping value in the method

In my app, for certain reasons I would like to be able to get the value of the @RequestMapping in the corresponding methods, however, I can't find a way to do that. Here are more details about what I want:
Suppose, I have a method like this: 

@RequestMapping(value = "/hello")
@ResponseBody
public void helloMethod(AtmosphereResource atmosphereResource) {
...
}

I would like to be able to get the mapping "/hello" within the method. I know, I can use placeholders in the mapping in order to get their values when the actual requests come, but I need a finite set of processable requests, and I don't want a chain of ifs or switches in my method.
Is it at all possible?

A:

This would effectively be the same, wouldn't it?
private final static String MAPPING = "/hello";

@RequestMapping(value = MAPPING)
@ResponseBody
public void helloMethod(AtmosphereResource atmosphereResource) {
   // MAPPING accessible as it's stored in instance variable
}

But to answer the original question: I wouldn't be surprised if there wasn't a direct way to access that, it's difficult to think of valid reasons to access this information in controller code (IMO one of biggest benefits of annotated controllers is that you can completely forget about the underlying web layer and implement them with plain, servlet-unaware methods)

