On Thursday, June 19, 2003, at 01:11 PM, Henning P. Schmiedehausen wrote:
"Attila Szegedi" <[EMAIL PROTECTED]> writes:
Hi,
sorry, got confused here. You and Geir are right. I was thinking about getResource() and getResourceFromStream() which must work as in a normal J2SE environment (as described in SRV.9.7.2).
So loading a templates from a jar in the WAR with the jar loader should work normally. Same goes to the classpath loader.
Regards Henning
----- Original Message ----- From: "Geir Magnusson Jr." <[EMAIL PROTECTED]> To: "Henning Schmiedehausen" <[EMAIL PROTECTED]> Cc: "Velocity Developers List" <[EMAIL PROTECTED]> Sent: Thursday, June 19, 2003 3:57 PM Subject: Re: resource loading from war - proposal
On Thursday, June 19, 2003, at 09:01 AM, Henning Schmiedehausen wrote:
Actually, I was wondering about this posting, too. IMHO, opening a file
with normal java.io in a "virtual file system" such as an unpacked war
environment "should work", else it is IMHO not an J2EE compliant
container. But as I deploy mainly on tomcat, I haven't actually tested.
Huh? I didn't think that J2EE required that.
Most certainly it doesn't. java.io.* file related APIs have a clear
semantics - they abstract whichever (if any) operating system filesystems
the JVM can see, period. Actually, most of the classes are declared "final",
(FileInputStream, FileOutputStream, RandomAccessFile) so their behavior
can't be modified in a subclass. There's no requirement in J2EE that it
should run on a custom JVM with modified java.io.* classes. J2EE container
must be implementable atop of a standard J2SE runtime.
OTOH, JNDI provides a nice standard interface for implementing virtual filesystems that can be handled in unified manner.
From what I know, and
it's very limited, that wasn't the case - I've had discussions with
Craig about this issue, and he raised the need to go find a file as a
problem when dealing with containers that don't unpack. Again, this is
just my impression - I don't know for sure.
Well, whoever writes a web application is heading for trouble if he accesses
webapp-packaged resources through anything else than
ServletContext.getResource[AsStream](...). ServletContext.getRealPath() is a
horrible hack that should have never existed, IMHO.
Attila.
geir
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH [EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/
Java, perl, Solaris, Linux, xSP Consulting, Web Services freelance consultant -- Jakarta Turbine Development -- hero for hire
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Geir Magnusson Jr 203-956-2604(w) Adeptra, Inc. 203-434-2093(m) [EMAIL PROTECTED] 203-247-1713(m)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]