开发者

I want to expose naked xml/json on VisualForce

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜