you can make your servlet to load the resource at the start up itself by using <load-on-startup>1</load-on-startup>. this will load the resource at the time of the servlet context creation (way before any requests)
OCP Java SE 6 Programmer, OCP Java EE 5 Web Component Developer, OCE Java EE 6 Web Services Developer, VMware Certified Core Spring 3.x Developer, EMC Proven Professional (ISM-V2)
Yasir Karim wrote:Thanks everyone.
When should a Servlet be throwing UnavailableException then?
The case in which your application tier is down, and the servlet is unable to process the request without application tier the servlet can throw UnAvailableException. UnAvailableException is thrown to indicate the client code to say "Something Fishy" in the request processing. so that client can take corrective action. if there are now corrective actions then the client is let to have a time out.