All, Giacomo, Carsten,

Looking into the AbstractEnvironment.changeContext() I do not understand
one part:

            File f = new File(this.context.getFile());
            if (f.isFile()) {
                this.context = f.getParentFile().toURL();
            } else {
                this.context = f.toURL();
            }

Is it essentially converting file to a directory entry where the file
belongs? Can it be then rewritten to something like:

            String s = this.context.toString();
            if (i != -1 && i + 1 < s.length()) {
                s = s.substring(0, s.lastIndexOf('/') + 1);
            }
            this.context = new URL(s);

With this change it:
1. Preserves original protocol. Before, "jndi:" URLs were converted to
"file:" URLs.
2. Works under tomcat as before.
3. Works under Borland App Server deployed as unpacked WAR (Thanks to
Nick Airey who tested this).

Does anybody see any issues with changing this bit of code?

Vadim



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

Reply via email to