I think they mean when they say that “persistent servlets” are just servlets that you define in web.xml, a la,
<servlet> <description>I'm permanent</description> <display-name>Servlet</display-name> <servlet-name>Servlet</servlet-name> <servlet-class>com.servlet.MyServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
This servlet will be launched when the server starts and will be stored until it shuts down, possibly (see below).
An example of a temporary servlet would be a .jsp file. It will not download the file until it is requested, and it will probably get rid of it after serving the request.
Looking at the servlet life cycle specification for a servlet,
When the servlet engine starts, the required servlet classes must be located in the servlet container. The servlet container loads the servlet class using the regular Java loading class .... After loading the Servlet class, the container starts it for use.
Then for eol,
A servlet container is not required to store a servlet loaded for any specific time period . A servlet instance can be active in the servlet container for a period in milliseconds, for the life of the servlet container (which can be the number of days, months, or years) or any number of time intervals between them. When the servlet container determines that the servlet should be removed from the service, it calls the destroy method of the Servlet interface to allow the servlet to free any resources it uses and maintain any permanent state. For example, a container can do this when it wants to save memory resources, or when it turns off. Before the servlet container calls the destroy method, it must allow any threads that are currently running in the servlet service method to complete execution or exceed the time limit set by the server. When the destroy method is called on a servlet instance, the container cannot route other requests to this servlet instance. If the container must enable the servlet again, it must do so with a new instance of the servlet class. After the destruction method is complete, the servlet container must empty the servlet so that it has the right to garbage collection.
So, I think that the bottom line, the servlet specification does not give any guarantees as to how long the servlet will be stored, this is a specific implementation, but I think it is a pretty safe bet that if you load it at startup, it will remain loaded for all the time the server is running.
For your specific use case, follow WhiteFang34 as using a servlet for anything other than service requests violates the IMO API.
[Edit] Wherever I look at how the servlet life cycle is managed, it seems that it will remain loaded for the entire lifetime of webapps.
Servlets
What is the difference between JSF, Servlet and JSP?
java servlet instance and session variables
But nowhere can I find a link that says I just don't know for sure.