Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 42949 invoked from network); 16 Apr 2007 16:23:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Apr 2007 16:23:04 -0000 Received: (qmail 28598 invoked by uid 500); 16 Apr 2007 16:22:45 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 28577 invoked by uid 500); 16 Apr 2007 16:22:45 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 28558 invoked by uid 99); 16 Apr 2007 16:22:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2007 09:22:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of thomas@polliard.com designates 66.139.75.214 as permitted sender) Received: from [66.139.75.214] (HELO loki.digitalassembly.net) (66.139.75.214) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2007 09:22:36 -0700 Received: by loki.digitalassembly.net (Postfix, from userid 30004) id A2C83208735; Mon, 16 Apr 2007 11:22:15 -0500 (CDT) X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on core.polliard.com X-Spam-Level: * Received: from [127.0.0.1] (pool-71-251-227-123.rcmdva.fios.verizon.net [71.251.227.123]) by loki.digitalassembly.net (Postfix) with ESMTP id 78CE8208735 for ; Mon, 16 Apr 2007 11:22:14 -0500 (CDT) Message-ID: <4623A28A.9050006@polliard.com> Date: Mon, 16 Apr 2007 12:21:30 -0400 From: Thomas Polliard User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: getResourceAsStream returning blank (NOT NULL) References: <3A070EE3-90C9-4BF0-BAD0-CD18D485C81D@polliard.com> <008501c77d95$fa1c8280$0400000a@animal> <006e01c77e3a$71507650$0201a8c0@timlap> <462122AA.2080904@christopherschultz.net> <009b01c77eed$c8766620$0201a8c0@timlap> In-Reply-To: <009b01c77eed$c8766620$0201a8c0@timlap> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000734-0, 04/16/2007), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=3.1.8 Tim Lucia wrote: > >> -----Original Message----- >> From: Christopher Schultz [mailto:chris@christopherschultz.net] >> Sent: Saturday, April 14, 2007 2:51 PM >> To: Tomcat Users List >> Subject: Re: getResourceAsStream returning blank (NOT NULL) >> > Tim, > > Tim Lucia wrote: > >>>> From: Johnny Kewl [mailto:john@kewlstuff.co.za] > >>>> InputStream in = > getClass().getResourceAsStream(sPackageNameWithSlashes); > >>>> If the class name is com.myCo.data > >>>> > >>>> You put it in like this /com/myCo/data > >>>> > >>>> Also because this stuff looks for a class loader.... I dont think it > will > >>>> work in a STATIC class. > >>>> Use a normal class.... > >>> Static classes are loaded by a classloader. You can't say getClass(), > >>> however. Instead you would say MyClass.class.xxx()... > Why not? The method isn't static, so there does exist a "this" on which > getClass() could be called. > > > If you have an instance, then of course you have a this and of > course you > > can call getClass(). If you haven't got an instance, you can't call > > getClass(). I.e., > > > public Foo { > > } > > > Foo.getClass() -- illegal. > > Foo.class.getResourceAsStream() -- legal > > > Presumably the poster above meant "singleton" (private default > constructor) > > rather than Static, as classes aren't static. In this case, you cannot > > instantiate an instance and so you can't have a this pointer. > > > Tim > > -chris That is correct, Singleton >> --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org