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




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to