java - How could Spring find his classes in a project? -


probably trivial , nonsense question but, being spring neophyte, i've asked myself "how spring can use classes in project extends classes?"

for example abstractannotationconfigdispatcherservletinitializer:

public class initializer extends abstractannotationconfigdispatcherservletinitializer  {      @override     protected class<?>[] getrootconfigclasses() {      }  } 

my initializer class it's declared in hand-built package non special name wonder: how spring find , instantiates initializer class? make sort of "package scan" of project trying classes extends own, or something?

the servlet container scans classes of webapp @ deployment time. allows auto-register classes annotated @webservlet servlets, classes annotated @webfilter servlet filters, etc.

it allows if find classes implementing javax.servlet.servletcontainerinitializer, , call onstartup() method, allows initializer register servlets , filters dynamically. spring class springservletcontainerinitializer such class, in turn delegates own initializer.


Comments

Popular posts from this blog

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -