��äȯ(Chaehwan Im) wrote:
> Calling another servlet within a servlet:
>
> * Know the servlet's name, given in the properties file
> * Get the servlet Object using servletcontext as
>
> servlet some_name =
> getServletConfig().getServletContext().getServlet("servlet_name");
>
> * We can call any public method of the servlet using this servlet object
>
> This tip is written by Krishna Roopa originally.
This will fail in Servlet API 2.1, getServlet() is deprecated.
In 2.1 you have to find the servlet yourself, use Class.forName(),
etc.
The replacement for getServlet() is ResourceDispatcher(), but it can't
handle such usage ( and there is a good reason for this - security ).
> >Hello,
> > I have a servlet running in one system or(server). This servlet
> >has to communicate with a servlet in another system(or server). How to do
> >this?
Use an URL, pass whatever request you want ( use the "Java Servlet Programming"
for examples of
posting).
If you are using sessions - you are in trouble ( and if you find a solution
for that, please let me know - I had
no luck getting an answer to this question ).
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html