Maxim Senin PMI wrote:

>
>
> I have a "core" servlet that is used in my server for sole purpose of
> loading
> other servlets and transfering control to them. It has alias like
> /servlets/ = InvokerServlet
> So, if user requests http://myserver.com/servlets/HelloServlet,
> this guy will resolve the real path of the servlet to, e.g.
> /http/pub/servlets-home/HelloServlet.
> But the problem is that ServletContext.getServlet(String) is
> deprecated. HOW
> ELSE CAN I LOAD SERVLET AND PASS CONTROL TO ITS service() METHOD
> without
> a. making InvokerServlet "know" details of server implementation
> b. without using class loader to load class, create instance of
> servlet and call
> its service() method. In ideal case, I want to let server manage
> instances of
> all servlets being run in the system.
>

As you have discovered, it is not possible to create a general-purpose
invoker servlet like this, because it requires "insider" knowledge of
the servlet container you are running under.  You'd need to be modifying
the guts of your existing servlet container to do this.

On the other hand, why are you doing it at all?  Every servlet engine I
know already provides this sort of capability already.

>
> Thanks a lot,
> Maxim
>

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to