1

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>

1 Answer 1

3

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .