I have worked around this by capturing the parameter string that is passed
to the original servlet and setting it equal to a String. Then when I call
the http address of the other servlet that I want to execute I added a
?paramString to the end of it.
Hope this helps,
--brian
>From: Hendrik Schreiber <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Inter Servlet Communication
>Date: Fri, 5 Nov 1999 13:28:48 +0100
>
>Hi!
>
>If you use an engine featureing API 2.1 you could use the RequestDispatcher
>and
>include(). The problem here is that this only works if servlet B has been
>called using POST and you might have to think of a different way to pass
>parameters. For example using setAttribute() of ServletRequest. In servlet
>A
>you could check for these attributes before doing things the ordinary way.
>Passing parameters with a querystring might also work with some engines [
>this
>way: ServletContext.getRequestDispatcher("/URI?Querystring=something")]
>
>Another possibilty is to simply open an URLConnection. That's not very nice
>as
>your servlets reside on the same server, but it might be very simple.
>
>Cheers,
>
>-hendrik
>- - - - - - - - - - - - - - - - - - - - - - - - - - -
> tagtraum industries http://www.tagtraum.com/
> jo! small&smart 2.1 servletengine
> Java Server & Servlets The German servlet book
> The WebApp Framework http://www.webapp.de/
>
>
>Rashid Amin wrote:
>
> > Dear All,
> >
> > How can I invoke a servlet(A) from other servlet(B) running in the same
>web
> > server. The servlet(A) takes some parameters using POST method parses
>the
> > parameters and shows the result in HTML. And I want to invoke
>servlet(A)
> > from servlet(B) sending the same parameters. How can I do that? Please
>help
> > me to coming out of this fix.
> > Thanking in anticipation.
> >
> > Regards,
> > Rashid.
> >
> >
>___________________________________________________________________________
> > 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
>
>___________________________________________________________________________
>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
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
___________________________________________________________________________
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