How the web-tier compiler works

本文介绍了Adobe Flex Web-Tier编译器模块,该模块可在Apache和IIS服务器上实现MXML文件的快速编译、测试及部署。通过浏览器直接刷新MXML文件即可查看更新效果,无需额外部署SWF文件及其包装文件。本文还对比了Web-Tier编译器与命令行编译器的优缺点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Introduction

 

Contents [Hide]


 

The Adobe® Flex® module for Apache and IIS compiler provides web-tier compilation of MXML files on Apache and IIS web servers. This lets you rapidly compile, test, and deploy an application: Instead of compiling your MXML file into a SWF file and then deploying it and its wrapper files on a web server, you can just refresh the MXML file in your browser.

You do not need a Java 2 Enterprise Edition (J2EE) server to use the web-tier compiler. The Flex module for Apache and IIS works with just the web server and a Java Runtime Environment (JRE).

This document refers to the Flex module for Apache and IIS as the web-tier compiler or the compiler module.

For web tier compilation, you can also use the Adobe Flex compiler module for J2EE application servers. The Flex compiler module for J2EE application servers is a ZIP file that you can deploy to most J2EE application servers that support servlets. The Flex compiler module for J2EE application servers also provides a JSP tag library that lets you write Flex applications in JSPs. It is available as a download on the Adobe web site.

How the web-tier compiler works

This process contains the following steps:

  1. The client requests a file with an *.mxml file extension.

  2. The web server forwards the request to the compiler module.

  3. The compiler module compiles the MXML file into a SWF file. The compiler module uses incremental compilation, so most compilations after the first one take less time to complete.

  4. The compiler module returns an HTML file to the web server, which returns it to the client.

  5. If the SWF file was compiled successfully, the HTML page embeds the SWF file. If the HTML file is an error page, the SWF file is not embedded in the HTML page and no further requests are made.

  6. The client then requests the SWF file based on the contents of the wrapper’s <object> and <embed> tags, if a current version of the SWF file is not in its local file cache.

When the web server receives a request for a file with the extension *.mxm.swf instead of *.mxml, the compiler module returns a SWF file only, and not the wrapper around it. In general, you should not request a SWF file directly, because it may run differently than if it were embedded in a wrapper.

The web-tier compiler has the following advantages over using the command-line compiler:

  • Provides incremental compilation (recompiles only the bits that have changed, not necessarily the entire application).

  • Saves you from having to deploy the SWF file and wrapper files after compiling.

  • Lets you customize the HTML wrapper or template.

  • Lets you debug by adding a query string parameter (?debug=true).

  • Helps you share updates to your application across working groups by sending a link to the web server.

  • Displays error and warning messages in the browser.

The web-tier compiler has the following disadvantages compared to using the command-line compiler:

  • Not for production use.

  • No built-in support for Express Install, deep linking, or version detection.

  • Caching relies on the web server.

  • On Linux systems, when you compile certain applications you may get an error message about not having a graphical display. This is due to the Java compiler being run by the Apache user, which does not have access to the desktop. To overcome this, add the following line to the flex-config.xml file used by the compiler:

    <headless-server>true</headless-server>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值