LISTSERV mailing list manager LISTSERV 16.0

Help for ZNG Archives


ZNG Archives

ZNG Archives


[email protected]


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

ZNG Home

ZNG Home

ZNG  October 2001

ZNG October 2001

Subject:

Re: Context in RPC calls

From:

"LeVan,Ralph" <[log in to unmask]>

Reply-To:

Z39.50 Next-Generation Initiative

Date:

Tue, 23 Oct 2001 08:29:37 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (111 lines)

I tried that too, but the Tomcat server is very smart and only creates one
instance of the class and only calls init with the parms for whichever
servlet got hit first.  Subsequent calls to either servlet use the instance
in cache.

Ralph

> -----Original Message-----
> From: Matthew Dovey [mailto:[log in to unmask]]
> Sent: Monday, October 22, 2001 7:28 PM
> To: [log in to unmask]
> Subject: Re: Context in RPC calls
>
>
> Ralph,
>
> I may be missing something, but it is quite easy to
> instatiate multiple
> instances of a servlet class bound to different urls and with
> different
> init parameters. The following web.xml extract does the job:
>
> <web-app>
>   <servlet>
>     <servlet-name>OxfordLive</servlet-name>
>     <servlet-class>org.jafer.servlet.ZNGServlet</servlet-class>
>     <init-param>
>       <param-name>dataBase</param-name>
>       <param-value>advance</param-value>
>     </init-param>
>     <init-param>
>       <param-name>target</param-name>
>       <param-value>library.ox.ac.uk</param-value>
>     </init-param>
>     <init-param>
>       <param-name>port</param-name>
>       <param-value>210</param-value>
>     </init-param>
>   </servlet>
>   <servlet>
>     <servlet-name>OxfordTest</servlet-name>
>     <servlet-class>org.jafer.servlet.ZNGServlet</servlet-class>
>     <init-param>
>       <param-name>dataBase</param-name>
>       <param-value>advance</param-value>
>     </init-param>
>     <init-param>
>       <param-name>target</param-name>
>       <param-value>library.ox.ac.uk</param-value>
>     </init-param>
>     <init-param>
>       <param-name>port</param-name>
>       <param-value>211</param-value>
>     </init-param>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>OxfordLive</servlet-name>
>     <url-pattern>/ZNG</url-pattern>
>   </servlet-mapping>
>   <servlet-mapping>
>     <servlet-name>OxfordTest</servlet-name>
>     <url-pattern>/ZNGTest</url-pattern>
>   </servlet-mapping>
> </web-app>
>
> Matthew
>
>
>
>       -----Original Message-----
>       From: LeVan,Ralph
>       Sent: Mon 22/10/2001 21:26
>       To: [log in to unmask]
>       Cc:
>       Subject: Context in RPC calls
>
>
>
>       So, we're hiding the database name in the URL.  The method
> handling the RPC
>       has no access to URL information.  How is it supposed to know
> what database
>       the search is for?
>
>       Now, I thought I had the answer once.  I was going to define a
> separate
>       servlet for each database, but they would all use the same
> servlet class.
>       Then, each servlet would get initialized with its own parameters
> and things
>       would be great.  But, the tomcat server knows that they are the
> same servlet
>       and only creates one instance of it.  So, I'm back to not
> knowing what
>       database I'm supposed to be searching.
>
>       Now, I can do this myself, if I override the SOAP toolkit's
> doPost method
>       and save the calling URL so that the searchRequest() method has
> access to
>       it, but that seems like a hack.
>
>       Any thoughts on how to handle this?
>
>       Thanks!
>
>       Ralph
>
>
>

Top of Message | Previous Page | Permalink

Advanced Options


Options

Error during command authentication.

Error - unable to initiate communication with LISTSERV (errno=111). The server is probably not started.

Log In

Log In

Get Password

Get Password


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

ATOM RSS1 RSS2



LISTSERV.LOC.GOV

CataList Email List Search Powered by the LISTSERV Email List Manager