
56 Building a Flex Application
■ Web application server
A web application server, such as JRun, ColdFusion, or PHP, can dynamically generate
pages that host your Flex applications. In this case, you can take advantage of the
application server’s available tag libraries and processing language to dynamically create a
wrapper for your Flex application. However, you must precompile your Flex application
before deploying it to this type of server. You can use any type of server, and not just a Java
application server, to serve up Flex applications, as long as you precompile that application
and that application does not use the services available with Flex Data Services.
■ J2EE application server or servlet container
You require a J2EE application server or servlet container, such as JRun, Tomcat, or
WebSphere, to run Flex Data Services. You typically precompile your Flex applications
before deploying them on a server running Flex Data Services. However, during
development you can request a Flex application’s MXML file in the browser to compile
the Flex application at run time. This invokes the web-tier compiler which generates a
wrapper and returns a compiled SWF file.
You can optionally install the integrated JRun J2EE server when you install Flex Data
Services. The integrated JRun server is a development-only version of the JRun 4
application server that is not intended for deployment. The integrated version of JRun
also includes the JRun Web Server (JWS) that you can use to handle HTTP requests. This
web server is also not intended for deployment.
At a minimum, you should have a simple web server in your development environment.
Without a web server, you can only run a Flex application in the standalone Flash Player or
request a SWF file directly in your browser. The former technique is not recommended
because it prevents your application from using many networking features of Flex. The latter
technique is not recommended because not all browsers support direct SWF-file requests.
Typical application development steps
You typically develop a Flex application by using the following steps:
1. Within a text editor or integrated development environment (IDE), such as Adobe Flex
Builder, Eclipse, or IntelliJ, insert the MXML root tags into an MXML file.
2. Add one or more containers.
3. Add controls to a container, such as input fields, buttons, and output fields.
4. Define a data model.
5. Add a web service, HTTP service, or request to a remote Java object.
6. Add validation to input data.
Commentaires sur ces manuels