I created @ControllerAdviceone that should set me some attribute of the model.
@ModelAttribute
public void globalAttributes(Model model) {
model.addAttribute("pageId", PAGE_ID);
}
This is a general example of what I need, and PAGE_ID represents some variable that the actual controller should set. Since it @ControllerAdviceis executed in front of the controller, how can I declare this variable and use it in the Recommendations section? If itβs even possible.
source
share