天天看点

整合FLEX+GAE+JAVA+BlazeDS

安装GAE开发环境:https://developers.google.com/appengine/docs/java/tools/eclipse?hl=zh-cn        很简单且是中文没有难度,最大的问题可能要翻墙头。

GAE方面的扫盲看:https://developers.google.com/appengine/docs/java/gettingstarted/creating?hl=zh-cn

接下来开始准备将flex般到GAE上:

在完成GAE开发环境的配置后,下载S3BlazeDS,按下面步骤。这种办法比较简单,老外已经将所有应该修改的地方做好了,只有几个地方手动小修改一下。

HowToInstall  

You can install S3BlazeDS on your Google App Engine project with the following procedure.

Preparing for your Google App Engine project(准备你的GAE项目,新建一个GAE项目在开环境中)

  • Make sure that your Google App Engine project is ready on Eclipse.(确认GAE Eclipse开发环境已经ok)
  • Edit appengine-web.xml of your app to add the following before the </appengine-web-app> tag:(打开appengine-web.xml,将下面的设置项打开,修改一下而已,没难度)
            <sessions-enabled>true</sessions-enabled>      

Download and install S3BlazeDS(下载且安装S3BlazeDS)

  • Download s3blazeds-xxx.zip from the Downloads tab and unzip it.(下载并解压缩)
  • Copy WEB-INF folder and overwrite it on war folder of your app.(替换整个WEB-INF目录)
  • Open web.xml.template from WEB-INF, and copy the whole text to clipboard. Edit web.xml of your app and insert the text before the</web-app> tag at the end of the file.(将web.xml.template中的内容粘贴到web.xml中,老外很细心,怕第二步的时候替换掉web.xml所以将文件命名为web.xml.template,这个手动做一下)

Creating Flash client and configure BlazeDS XMLs

  • (TODO)
  • Build your server
    • Edit war/WEB-INF/flex/remoting-config.xml to configure your destination. For example:(这块不用管,正常的remote object方法,和本地编程一样)
          <destination id="pingService">
              <properties>
                      <source>slim3.service.PingService</source>
                      <scope>application</scope>
              </properties>
          </destination>      
  • Build your Flash client with Flash Builder to call the destination(新建Flash项目。这个和本地开发一样,填写根URL时注意下端口即可,不是我们常用的8080了,按你GAE上面的端口,将输出文件夹直接指到GAE项目的war)

http://kunshansoms.appspot.com/test2.html   如果你能翻墙就能看到我的第一个GAE了

整合FLEX+GAE+JAVA+BlazeDS
整合FLEX+GAE+JAVA+BlazeDS