Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 313 invoked from network); 21 Apr 2009 16:14:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Apr 2009 16:14:34 -0000 Received: (qmail 89602 invoked by uid 500); 21 Apr 2009 16:14:31 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 89550 invoked by uid 500); 21 Apr 2009 16:14:31 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 89540 invoked by uid 99); 21 Apr 2009 16:14:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 16:14:31 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mindas@gmail.com designates 209.85.219.179 as permitted sender) Received: from [209.85.219.179] (HELO mail-ew0-f179.google.com) (209.85.219.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 16:14:23 +0000 Received: by ewy27 with SMTP id 27so2579372ewy.5 for ; Tue, 21 Apr 2009 09:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7ScxkSMrFO6z8IsIf4g9prL7XfjllhFGfLYTMxu7UmE=; b=N51CXY+KCJ539KFPm7vZKTrxeInG0Ksr65PBoIDH7TKGSrLyd0M+5N0rangr9dmMdq EgZ38r/OoeN92va66r0elNuxO4RnvMLYwfP1EiVXoKRq7+J57lIedi+B+WlvCZVy0xse KGunUM/c/6iD44IXWpGN8r2j9i41aL50UDKBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PlCpjJRBLC19xyOx9CQ9mnLBo6CpIvZ9wN706bDbmay5hcJ6M+buKOq5DOJ2VPL1Af Zfsw8kLFdd63R6Ry1Z0ItuN0xVOf0xJXcyT/UP4k1bOTuwKu+qgON1GSRHoaiCiBgwK8 hwPFARGOf8X3NNF9ZomnwsIqnmBHEtkGZTnoo= MIME-Version: 1.0 Received: by 10.210.37.16 with SMTP id k16mr7241322ebk.63.1240330443413; Tue, 21 Apr 2009 09:14:03 -0700 (PDT) In-Reply-To: <3CA90CC651AE3F4BAEDF8A5B78639C8C02BC28D0@mail02.tveyes.com> References: <3CA90CC651AE3F4BAEDF8A5B78639C8C02BC28D0@mail02.tveyes.com> Date: Tue, 21 Apr 2009 17:14:03 +0100 Message-ID: Subject: Re: Servlets Sharing Resources From: =?ISO-8859-13?Q?Mindaugas_=DEak=F0auskas?= To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Servlets are stateless and they must extend javax.servlet.http.HttpServlet, therefore I'm afraid the idea of manager class is probably unrealistic. The stuff you want to achieve normally works by either placing objects into the HTTP session (user-bound) or attaching them to your application context (application-bound). Regards, Mindaugas On Tue, Apr 21, 2009 at 5:01 PM, David Seltzer wrote: > Hi All, > > Sorry for the slightly off-topic question, but I've just run into a gap > in my understanding of Servlet programming. > > The question: Is it possible for two servlets to share access to an > instance of IndexSearcher or an IndexReader? I'm thinking about setting > up a Search servlet to provide XML search results and a Statistics > servlet to provide numeric statistics based on the same data. > > I imagine the right way to do it is to make both servlets child classes > of a manager class, but I'm not sure how that would look. I'm also not > sure how to configure tomcat in this scenario? > > -Dave > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org