Add a Model Attribute using ControllerAdvice

Viewed 2921

I have marked a class with @ControllerAdvice

Added a method

@ModelAttribute
public void setSourceAppId(Model model)
{
    model.addAttribute("myattribute","1234");
}

But this method is not getting called at all.

1 Answers
Related