Whether or not you use annotationsâ€”and especially if you don’tâ€”it’s important to understand the performance impact they can have on a server at startup. In order for the server to discover annotations on classes, it must load the classes, which means that at startup, a server will look through all the classes in WEB-INF/classes and WEB-INF/lib, looking for annotations. (Per the specification, servers don’t have to look outside these two places.) You can avoid this search when you know you don’t have any annotations by specifying a full attribute on the
<web-app>root like this:
When you’re not using annotations, this reenables lazy class loading.