Flex 2 Tag Library for JSP
From Adobe Labs
Note: Flex 2 Tag Library for JSP is included as part of Adobe® LiveCycle® Data Services ES and is now shipping on Adobe.com.
| Table of contents |
What is the Flex 2 Tag Library for JSP?
The Flex™ 2 Tag Library for JSP is a set of JSP tags that you can use to embed Flex applications to a JSP page. This is prerelease software.
The <mxml> tag compiles the MXML code, if required, and then generates the HTML fragment to load Adobe® Flash® Player and the resulting SWF file in your JSP page. You can use do this in two different ways. The source tag attribute lets you specify the source file to compile. This is useful because the JSP tag writes the HTML fragment for you. The other approach is to specify the source as the body content of the tag. Then, you use JSP scriptlets to generate the MXML source.
The <flashvar> tag lets you to pass variables to a Flex application. You access these variables by using the Application.application.parameters object.
Although the Flex 2 Tag Library for JSP is similar to the tag library in Flex 1.x, there are some differences. The tag attributes of the <mxml> tag are simpler; full control of all the HTML wrapper attributes is no longer available. However, the tag library includes attributes that enable history management and Flash Player detection on a per-tag basis. The <param> tag that let you add Flash Player parameters to the HTML wrapper was eliminated in an effort to simplify tag usage. The <flash> tag, which generated an HTML wrapper for a pregenerated SWF file, was eliminated also.
When Should I Use the Flex 2 Tag Library for JSP?
You should use the Flex 2 Tag Library for JSP to do any of the following:
- Include an MXML (Flex) application within an existing HTML/JSP page.
- Include history management or Flash Player detection for one application but not another application.
- Present an MXML application if the correct version of the Flash Player is installed, or an HTML version otherwise.
- Present one of a few versions of the same basic application determined through logic in a JSP page.
What Are the Limitations?
If you use the Flex 2 Tag Library for JSP incorrectly, overall application performance can suffer because of excessive recompilation.
In general, there are no performance concerns if you use the <mxml> tag and compile MXML source code by using the source attribute.
The following alternate approaches do not modify the actual MXML code that a JSP page generates and do not cause excessive recompilations. Before deciding to use the tag library with your application with inline MXML source code, consider whether one of the following options would be more appropriate:
- Separate the presentation from the data so that you can use LiveCycle Data Services (previously Flex Data Services 2.0.1) to populate the data in the application.
- Pass in the dynamic data by using the
<flashvar>tag. You can safely use different name-value pairs on the<flashvar>tag for each JSP page execution, because the differences do not cause a modification and recompilation of the MXML source code. - Manipulate the presentation by using ActionScript.
What Do I Need to Use It?
The Flex 2 Tag Library for JSP requires the following:
- LiveCycle Data Services ES
- A supported Java application server or servlet container
Download and Installation
Flex 2 Tag Library for JSP is included as part of Adobe® LiveCycle® Data Services ES and is now shipping on Adobe.com.
Flex 2 Tag Library for JSP Reference
|
Tag |
Description |
Attributes |
|
|
Compiles the MXML code and generates the HTML wrapper. Include MXML source as body content or specify an external source file with the |
|
|
|
Specifies a variable to pass to your Flex Application. |
|
How Do I Find Out More?
The following sections of the Flex 2 documentation may be helpful in understanding the JSP tag attributes-
- Flex 2 Developer's Guide - Using the History Manager
- Flex 2 Developer's Guide - Communicating with the Wrapper
- Building and Deploying Flex 2 Applications - Creating a Wrapper
