I want to get some best practices advice on a pretty common UI architecture scenario when designing a portal site ...
"A web browser visit website X which generate a dynamic page that contains some contents from another website Y".
I can think of two different strategies to tackle this ....
STRATEGY ONE : Website-X fetch HTML content from website-Y and compose the utimate HTML page before sending back to browser
1) <jsp:include> only works within a server engine, so this is not a solution for including content from another site.
2) Website-Y expose its content via a SOAP interface for website-X. I dislike this approach because the code in website-X become tightly coupled with the content structure of website-Y, also code in website-X needs to take on the burden to develop the presentation logic of the content it extract from website-Y.
3) Website-X simulates a web browser and make a HTTP request to fetch content from website-Y. I dislike this because in order for website-X to impersonate the user, it needs to know the password information of the user, this leads to security concerns. On the other hand, code in website-X needs to take the burden to handle cookies that it obtains from website-Y
STRATEGY TWO: Website-X generates a result HTML page which contains instructions for the browser to fetch additional content from website-Y
1) Conceptually this is similarly to how the HTML <image> tag works, but I'm not aware of an equivalent HTML tag for fetching HTML content.
2) Use HTML frame is not satisfactory because I think you have to define the whole page in frameset instead of just a portion of your HTML page. Also this cause many roundtrips to the server which slow down performance.
Any better ideas ??