-2

I want to check session and add it's information to model, but i don't want to add code in every controller, so is there something I can use to solve this problem?

deru
  • 3
  • 1
  • 2
    Welcome to Stack Overflow, please take some time to follow the [Stack Overflow tour](http://stackoverflow.com/tour) and read about [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) Also provide us the relevant code you wrote for your question (You can also read [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)) – Dipiks Jan 23 '17 at 08:34
  • If I understood you correctly (or close enough), then in spring mvc, there is a thing called ControllerAdviser. Look that up. That may have some use for you. – Faraz Jan 23 '17 at 08:39
  • Thanks, I solve it by using interceptor. – deru Jan 24 '17 at 09:03

1 Answers1

0

You can use interceptor. Follow below url to get more idea about it.

https://www.mkyong.com/spring-mvc/spring-mvc-handler-interceptors-example/

Opv
  • 440
  • 1
  • 3
  • 17