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