The original intention was to be able to configure filter mappings with annotations (i.e. @FilteredBy below) instead of adding filter mappings to the web.xml file. Something like:
@Controller
public class MyController {
@RequestMapping(value = "/special/page.html")
@FilteredBy("SpecialBean") // <-- *** desired ***
public String doSpecialStuff() {
return "special/page";
}
}
I see that Servlet 3.0 introduces @ServletFilter which can be applied any object method and the mappings are defined by @FilterMapping. However, I want invert the responsibility of the mapping to the controller method consuming the shared logic of my "SpecialBean".