@ Override protected void initialize ( ) throws ServletException { /* * The servlet defines any number of resource providers, and * configures itself to use them by calling * setResourceProviders() */ List < IResourceProvider > resourceProviders = new ArrayList < IResourceProvider > ( ) ; resourceProviders . add ( new RestfulPatientResourceProvider ( ) ) ; resourceProviders . add ( new RestfulObservationResourceProvider ( ) ) ; setResourceProviders ( resourceProviders ) ; }
The initialize method is automatically called when the servlet is starting up so it can be used to configure the servlet to define resource providers or set up configuration interceptors etc .