I have a Java Spring MVC based web app.
I have three different @Controller
classes with a variety of @RequestMapping
methods that handle all web requests to the application.
Works great.
Now I have implemented a licensing system so there must be a license file in place for the application to be used.
When any web request is made, I will check the license file to make sure it is not expired and show a "License is expired, contact support" message.
My question is ...
Is there a way to hook into every call made through the Spring MVC dispatch servlet or every @Controller method so I can check licensing in one place?
I could so something like put a licenseService.checkLicense()
in every @Controller method, but I'd rather do it in one place because it would be cleaner.