Brief introduction:
It is well known that cross-domain problems are a very common requirement, such as having a client's EXT-JS control render a JSON object from the server side. We can solve them in many ways, such as JSONP. However, in Liferay, we can use the Serveresource method to gracefully resolve Cross-domain access issues.
Whiteboard Analysis:
Here is the whiteboard on the technical symposium:
Workaround:
First write a Serveresource method to deal with the remote JSON object, which can be encapsulated as a middle-tier in the remoting JSON resource, and then provided to the EXT-JS code in this domain to render.
Of course, our resources here must be stated on the page with <portlet:resourceURL/> to allow the client Ext-js to use the specified variable to access the code:
The client, the basic EXT-JS, is able to render the JSON resources we serveresource provide, because it is within this domain, so there is no cross-domain.
This article from the "Cohesion of parallel Lines" blog, please be sure to retain this source http://supercharles888.blog.51cto.com/609344/1004251