ArcGIS API for Flex 发布应用时 安全沙箱的问题

http://resources.arcgis.com/en/help/flex-api/concepts/index.html#/Deploying_an_application/017p00000019000000/


Deploying an application

Version 3.1

Adobe Flash Builder setup

For improved performance, adjust your Adobe Flash Buildersettings as follows:

  • Click Project > Properties > Flex Compiler,then uncheck the Enable integration with browser navigation checkbox. Unless you've added code to specifically support deep links, there is no need for this box tobe checked.

Compiling an optimized SWF file

When you compile an application in Adobe Flash Builder, adebug version is created. While useful for development purposes,this is not optimal for deployments.

When you're ready to deploy an application, use the Adobe Flash Builder Export Release Build process to create anoptimized release-quality version of the SWF file as follows:

  1. In Adobe Flash Builder, click Project > Export Release Build from the main menu.
  2. Click Finish.

Production workflow

The compiled application (SWF file), its HTML wrapper, and itsrelated files (for example, shared libraries) can be moved onto any webserver. There are no dependencies on any additional files hosted byyou (or Esri) at run time, because the compiled SWF file contains all thenecessary code.

ArcGIS API for Flex 发布应用时 安全沙箱的问题_第1张图片

When a web user accesses the HTML wrapper file, the browser verifies that Adobe Flash Player is installed and is using the specified minimum Flash Player version. The client browser then downloads the SWF file. At this point, the user might not connect back to this web server at all but instead connect directly to the servers containing map content and tasks. If your web application is not hosted on the same server as ArcGIS Server, you must have a crossdomain.xml file on ArcGIS Server.

About crossdomain.xml

To access data from a server other than the one hosting yourFlex application, the remote server needs to have a cross-domainfile in the root directory. For security reasons, the web browsercannot access data that resides outside the exact web domain wherethe SWF file originated. However, Adobe Flash Player can load dataacross domains if permission is granted from the server. This isaccomplished by including a small crossdomain.xml file on theremote server that permits Flash to connect to services on thatserver. See the following code example:




    
    

For additional information, see Using cross-domain policy files in the Adobe Flex 3 Help, Adobe TechNote "External data not accessible outside a Macromedia Flash movie's domain," or viewa sample cross-domain file.

Deploying crossdomain.xml

To deploy the cross-domain file on ArcGIS Server, see theinstructions below specific to your platform and version. Note the crossdomain file goes on the server with ArcGIS Server, not the server with your application.

  • For 10.1, the location is C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\contexts\rootapp. Note that 10.1 comes with crossdomain.xml already installed, so unless you want to make changes, it should work successfully.
  • .NET—Add crossdomain.xml to your web server's root directory, for example,C:\inetpub\wwwroot.
  • Java—Add crossdomain.xml to\ArcGIS\java\manager\web_outputfor 10.0 or\ArcGIS\java\web_output for9.3 installations of ArcGIS Server. On Windows, the defaultlocations for these directories are as follows:
    • 10.0—C:\ProgramFiles\ArcGIS\Server\java\manager\web_output
    • 9.3—C:\Program Files\ArcGIS\java\web_output

To deploy the cross-domain file on ArcGIS Spatial Data Server, see the following instructions specific to your platform and version:

  • ArcGIS 10.1 Spatial Data Server for the Java Platform installs the client access policy files in the Java installation directory (for example, C:\Program Files\ArcGIS\SDS10.1\java). Copy the crossdomain.xml file to your web server's root directory. For example:
    • If you use Apache Tomcat, place the appropriate client access policy file in $CATALINA_HOME/webapps/ROOT (Linux) or %CATALINA_HOME%\webapps\ROOT (Windows) prior to deploying.
    • If you use IBM WebSphere or Oracle WebLogic, create a .war file that contains the appropriate client access policy file and deploy it to the web server's root directory.
  • For ArcGIS 10.1 Spatial Data Server for IIS, install the ‘Cross-domain Policy Files’ when you run the installation wizard. This installs the crossdomain.xml file in the web server root location.

你可能感兴趣的:(ArcGis,API,for,Flex)