Those are meant to specify the loading order for servlets. However, servlets are more meant to control, preprocess and/or postprocess HTTP requests/responses while you sound like to be more looking for a hook on webapp's startup. In that case, you rather want a ServletContextListener
.
public class Config implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
// Do your thing during webapp's startup.
}
public void contextDestroyed(ServletContextEvent event) {
// Do your thing during webapp's shutdown.
}
}
which you register in web.xml
as follows:
<listener>
<listener-class>com.example.Config</listener-class>
</listener>
See also: