If I initialise a bean in the servlet, what lifespan will it have?
Only as long it is referenced, just like any other
java object. If you create a bean in the servlet, and then don't do anything else with it, it will go out of scope and made available for garbage collecting when the servlet ends execution.
There is a new instance of the servlet for every session...?
No. There is one instance of the servlet per web application.
Or should I save the bean to the session in the servlet, then retrieve it from the session in the JSP pages?
If you want the bean to be available to all JSPs in the session, this is the way to do it.
You would the useBean tag on the JSP to retrieve the bean if you are writing old-fashioned JSPs with scriplets, or EL expressions and the JSTL if writing modern scriptless JSP pages.
Also, is it reasonable to just intialise the bean when the web application is first accessed (action="start")
Only if the data you are storing is to be identical for all sessions/users and all JSPs.
I'm also a little concerned about this "start" action. Are you actually depending upon an external hit in order to initialize the application? If so, I'd highly recommend re-thinking that. A context listener would be a much safer approach.
If however, by "start" you are referring to an action more along the lines of a user login, then it may be ok.
[ October 06, 2005: Message edited by: Bear Bibeault ]