--

Anil Amarakoon wrote:

> --
>
> Hi,
>
> I want to get a reference to another servlet ( this is already loaded
> when jserv starts-Startup Servlet)
> myServlet some_name = (myServlet)
> getServletConfig().getServletContext().getServlet("servletAliasNameFromZone");
>
> Does this instance loaded by system class loader?? (I mean two instances
> of same servlet load from the servlet class
> loader and system class loader??)
>
> All I can see is that in the JServServletManager returns JServContext if
> servlet is already loaded. So I guess I am
> talking to the servlet that loaded by servlet class loader. (hope I am
> right)
>
> I am just trying to call method BB of servlet B from servlet A.
>
> Thank you in advance for any clarifications
>
> Anil
>

The servlet class loader checks the system class path first, and then the zone
repository, so wherever it found your servlet class is where it loaded from.  As
long as your servlet does not implement SingleThreadModel, getServlet() returns a
reference to the one and only instance of this servlet.

I ***strongly*** suggest, however, that you redesign your application not to rely
on getServlet().  In the version 2.1 API, the getServlet() method was deprecated
(for a bunch of very good reasons we don't need to go into here) so you won't be
able to use this approach once Apache JServ is upgraded to the new API (which
will happen in the near term through the Jakarta project ... see
http://jakarta.apache.org for more info).

Craig McClanahan




--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to