Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: Can I read file resources from a .WAR file at runtime ?

Justin Ruthenbeck

2003-10-14


At 05:45 AM 10/14/2003, you wrote:

>Howdy,
>Yeah, I usually prefer ServletContext#getResource or getResourceAsStream
>over the Class loader approach (Justin's suggestion) as well.
>
>Yoav Shapira
>Millennium ChemInformatics

Both are definitely good options ... I prefer to go directly to the
Classloader for consistency's sake -- sometimes I read resources from
Servlets (or other objects that have ServletContext visibility), but most
often in my J2EE apps I read resources from plain-old-java classes which I
don't want to tie to J2EE.

As always, do what suites you best.

justin

____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
  See http://www.nextengine.com/confidentiality.php
____________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.