One more point I want to add. In spring-servlet.xml
we include component scan for Controller package.
In following example we include filter annotation for controller package.
In applicationcontext.xml
we add filter for remaining package excluding controller.