[SalesForce] Embedded HTML in visualforce page

I'd like to know if this is possible at all. What I want to do is to create a wrapper VisualForce page which simply takes a URL as a parameter, and renders it. I have tried this, but it renders the HTML text and not the page. Any suggestions?

Thx,
Hamayoun

Controller:

public class wrapper1 {

public String output {set;get;}

public wrapper1 () {

    String url1 = ApexPages.currentPage().getParameters().get('url1') ;
    PageReference pr = new PageReference (url1);
    output = pr.getContent().toString();

}

}

VisualForce:

<apex:page controller="wrapper1">
<apex:outputPanel>
  {!output}
    </apex:outputPanel>
</apex:page>

Best Answer

Warning: What your proposing to do is a significant security issue. I'd highly suggest that you severely restrict where the page will pull HTML in from or look for a different option.

See also: HTML Injection


Try switching to an apex:outputText and setting the escape attribute to false. This will stop Salesforce from HTML escaping the content.