I want to create a pointcut that matches any method in my web controller that contains ModelMap:
pointcut addMenu(ModelMap modelMap) : execution (public String example.web.MyController.*(..)) && args (modelMap); before(ModelMap modelMap) : addMenu(modelMap) {
My problem is that this only matches methods with the ModelMap parameter ONLY , the others are not mapped because they contain too many parameters. For example, this is not intercepted due to the "req" parameter:
public String request(HttpServletRequest req, ModelMap modelMap) {
Is there a way to map all methods to a ModelMap parameter without adding a pointcut delegate for every possible combination of parameters?
source share