Announcement Announcement Module
Collapse
No announcement yet.
how to define AspectJ for Controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to define AspectJ for Controller

    if the AspectJ is applied on pojo Java:
    Code:
    public aspect test {
    	pointcut controlling(User u): execution(* *(User,..)) && args(u);
    	before(User u):controlling(u){
    
    	}
    }
    then I can capture methods like A.set(User user).
    but if I want capture the methods in controllers:
    Code:
    public aspect test{
    	pointcut controlling(User u): execution(* *(@ModelAttribute User,..)) && args(u);
    	before(User u):controlling(u){
    
    	}
    }
    then nothing is matched. actualy in controller there are methods like:
    Code:
    @RequestMapping(value = "register", method = RequestMethod.POST)
    public String processRegisterSubmit(@ModelAttribute User user, BindingResult result, SessionStatus status, Model model) {
    }
    where is the problem?
Working...
X