We are developing a new feature to current spring application: when user try to log on the main page, we first need to check a tag in an xml file(like db version or so) to determine whether user can direct to the main page. If the version is current, run the spring application, otherwise redirect to another page let user to upgrade the database then restart the app(manually).
I think there are two solutions:
-
make this feature using spring so that let spring mvc handle the rest.
-
make a filter before the servlet level that redirect to the upgrade page when wrong version. Not even bother to get into spring application.
So which one sounds more reasonable? Please share any ideas, thanks.
I think using
Filtershere is overkill, becauseFiltersare checked in every request and you only need this to be checked once, when user logs in.So, the best approach should be to redirect conveniently depending of XML tag check, after user logs in (I think this is your first proposal).