lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "patrick o'leary" <pj...@pjaol.com>
Subject Re: Servlets Sharing Resources
Date Tue, 21 Apr 2009 16:50:36 GMT
Why not have 1 servlet and based on a parameter / url, serve 2 different
outputs?

if(request.getString("asXML") !=null)
   showXML();
else
   showOtherStuff();

Save yourself the hassle of dealing with jndi / contexts / spring or
SingleTons

On Tue, Apr 21, 2009 at 12:01 PM, David Seltzer <dseltzer@tveyes.com> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message