Rajah, your problem is quite intriguing, and while I do not have an
answer
to your question, I thought I may offer a workaround:

How about declaring a *static* boolean say called fileHasBeenRead
initialized to
false. And within the doGet or/and doPost methods, write the code for
the
file reading within a try/catch block as follows:

if (!(fileHasBeenRead)){
  try{
    //open file, read it, etc..
    fileHasBeenRead = true;
  }
  catch(Exception e){
    //redirect using the response object:
    resp.sendRedirect(errorServlet path);
  }
}
That way you can sort of simulate the action of an init:
do the file reading just once and right after the class is loaded.

Hope this helps!
Geeta

PS. This message seems to have have had some problems, so I am resending

it. I apologize in advance if this has already found its way to your
mailboxes: I
am new to this business of list-services, so I may very well have done
something wrong. Once again, sorry in advance!

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to