I have some controllers in which some methods annotated with request mapping are expecting request param of codes
(list of string)
and I want to authorize those list of codes to check if the current user has access to all the codes in the list and filter on those. What I want is to create a generic filter for those controllers I cannot apply this with URL mapping. Is there a way to create a filter and apply an annotation to only some methods(Request Mapping)?
Another question is it OK to keep list of 600 codes in session or is a db call more appropriate? I am expecting these authorization of codes calls frequently (user can view (more frequent), update(less frequent) of the data associated with codes)
Update:
For example I have two methods :
@RequestMapping(value="/getInfo")
public void viewInfo(@RequestParam("codes") List<String> codes)
@RequestMapping(value="/getDetailInfo")
public void getDetailInfo(@RequestParam("codes") List<String> codes)
Now if I want to validate the codes I have to put validation logic in both method what i want is to write a filter/Interceptors to check if user has access to see all the codes in the list I can user url mapping to intercept the request I was asking that is there a generic way that I can use on method to validate the codes without adding url mapping.