Seems like the slow Tomcat 7 startup problem can be resolved with "metadata-complete" set to "true" in the web.xml, like so:
<?xml version="1.0" encoding="UTF-8"?>
<web-app metadata-complete="true" id="WebApp_ID" version="3.0"...
The problem is that Tomcat scans for annotations at startup, and this significantly slows it down. My time is cut down from 25 secs to 5 secs. (More info here: Tomcat and Servlet 3.0 Web Configuration)
However, I have some annotations in my code, like:
@ManagedBean
@RequestScoped
@Override
...
I am confused - will my code work after I have set metadata-complete="true"? Do I have to remove annotations and move everything into web.xml?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…