I am trying to expose self generated XML (or JSON) from VisualForce. However I cannot find the way to override the parent pages on an apex:page component so I am getting the whole menu, bars and all he extra html around.
But I only want to serve the selfgenedated xml. Basical开发者_JAVA技巧ly I want to do this:
http://salesforceserverXX.com/apex/page ---->
content
Is that possible?
Yes it's possible. Below VF code output JSON string. Please note the showhedear and contentType parameter. ControllerClass is the apexclass hosting "processRequest" method which generates a JSON string "requestReponse"
<apex:page controller="ControllerClass"
contentType="text/javascript"
showHeader="false"
cache="true"
expires="1"
action="{!processRequest}">{!requestResponse}</apex:page>
Yes, check out this discussion thread.
精彩评论