Let me get this straight
In effect what you are after is a proxy to an ftp site, so that the html files there can be served as if the ftp site was an http server.
Sounds convoluted to me... A huge overhead for what gain?
So you need a
servlet which can connect to this ftp site, download the resource you want from it, and then send that resource out in the Response.
This servlet will also need to be invoked on links from this downloaded page.
One servlet can be configured to handle all the requests. I would approach it in this fashion:
Configure a servlet filter to dispatch all requests going to /ftp/* to the "ftp servlet", and then use the remaining part of the request to determine what resource to download from the ftp site.
e.g. accessing /myWebapp/ftp/pageFromFTPSite.html would invoke the "ftp" servlet, and load "pageFromFTPSite.html"
Depending on the html pages deployed on the ftp site that may or may not be enough.
If the html pages use relative links ie
that should work perfectly well.
If they use absolute links in some fashion eg it would get complicated.
Your servlet would have to modify the html on the way through to generate hyperlinks that would direct back through the ftp servlet again.
Possible, but even more overhead again.
those are my thoughts anyway.
cheers,
Stefan