hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Johnson <e...@tibco.com>
Subject Re: Servlet communication (was Re : Bug 13463)
Date Tue, 18 Feb 2003 15:16:14 GMT
Aurelien,

Aurelien Pernoud wrote:

>I'm making two distants servlet interact using httpclient. I get the stream
>and "strip" what is unnecessary, rewrite some tags, and locations href, well
>I'm making changes to the HTML returned.
>
>Imagine now the two servlets are on the same server, it works fine (I make
>call to localhost), but I know it could be much faster and more reliable
>making servlet interacts directly. So I took a look at the way to do the
>things I do (get the stream from another servlet, work with it and write in
>the stream of another servlet) and the only thing I found are :
>
>- include() method on servletrequestdispatcher, and forward()
>  
>
You could use the "include" function, but create your own implementation 
of the HttpServletRequest and HttpServletResponse interfaces.  As for 
"more reliable", you might find it more reliable to "decouple" the two 
servlets by using a URL, rather than trying to tightly couple them via a 
RequestDispatcher.  In other words, keep your existing solution.  In 
that way, if you decide later that "more reliable" means better 
performance, you could put the two servlets on two different machines, 
and get twice the performance.

>But I can't simply include the response, I have to work with it before
>including it in the response. Any way to do it without breaking the working
>of the distant servlet ?
>
>Sorry for asking here, but I don't know where to post this kind of
>questions... Sun forums ?
>  
>
You might try the Tomcat lists.

>Thx for any pointers,
>Aurelien
>
-Eric Johnson


>  
>


Mime
View raw message