The following 2 things both implement the front controller pattern
:
DispatcherServlet
defined by SpringFilter
defined by servlet specI think login logic should be placed in the front controller
. But which one should I use in a Spring MVC web application?
Instead of implementing that by your own, I strongly recommend to use Spring-Security.
BTW: The way Spring-Security hooks into the HTTP-Request handling process (the "entry"-point), is based on a Servlet filter (org.springframework.web.filter.DelegatingFilterProxy
).