You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guys, I'm trying to add an @ControllerAdvice class to put global variables to access from my jte file using spring mvc, do you know if runs?
example:
@ControllerAdvice
public class GlobalModelAttributeAdvice extends AbstractController {
@ModelAttribute("loggedInUser")
public LoggedUser addAttributes(Model model) {
var user = getLoggedInUser();
if (Objects.isNull(user)) {
return new LoggedUser("Usuário não logado", Set.of());
}
return new LoggedUser(user.getDisplayName(), user.getRoles());
}
}
Do you know if it's possible, I don't found nothing about in docs.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Guys, I'm trying to add an @ControllerAdvice class to put global variables to access from my jte file using spring mvc, do you know if runs?
example:
Do you know if it's possible, I don't found nothing about in docs.
Beta Was this translation helpful? Give feedback.
All reactions