I'm working on a servlet that does some work in the init() and could potentially throw several exceptions. If this does happen, I'd like to show the user a good error page with contact info on it instead of a stacktrace. How can I do this without the request/response available to me? I must be missing something...
Since there is no request/response there really isn't a page for you to display to the user, and what user would you show it to?
init() executes upon servlet load which can happen as early as when the servlet container is starting up, long before any users could potentially be hitting your app.
What kind of work are you performing in the inti() method that warrants user feedback? Would it perhaps be more approriate to perform this work in the context of a request? And if it truly is init()-type of work, who should see the failure? Your users, or the server admin?
hth,
bear
[ March 06, 2003: Message edited by: Bear Bibeault ]