Howdy,

>*But* this did not work, which I guess is a "relative issue":
>
>...
>   public void init(ServletConfig config) throws ServletException {
>     super.init(config);
>       try {
>          this.passwordFile = config.getInitParameter( "passwordFile"
);
>          this.passwords = new Properties();
>          passwords.load( new FileInputStream( passwordFile );
>       } catch( IOException ioe ) {}
>   }
>...
>
>Can someone summarize why the second example does not work with
relative
>paths? I understand why the first one does.

Two reasons, one certain and one possible:

1. Certainly, using a FileXXX class will attempt to interpret the init
parameter value (/WEB-INF...) is an absolute path, because that's how
absolute paths are defined for files.

2. If you happen to be running from a packed .war file, you may NPE when
trying to construct a FileInputStream as File-based accesses are not a
given in a packed .war.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to