Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform. Flex applications can be written using Adobe Flex Builder or by using the freely available Flex compiler from Adobe.
Unjar the blazeds.war file from BlazeDS into your application server's deployment folder. For instance, on JBoss use /server/default/deploy/blazeds.war
Start Eclipse / Flex Builder
Create a new Java Project that you can use to configure BlazeDS and add Java classes to your web application.
Use a project name like "blazeds_server"
Create the project from existing source; use the path of the WEB-INF directory of your deployed BlazeDS WAR, such as: /server/default/deploy/blazeds.war/WEB-INF/
Add the src directory to the build path
Use the WEB-INF/classes directory as the output folder
Create a new Java class called HelloWorld.java with the following code:
public class HelloWorld { public String sayHello(String name) { return "hello, " + name; } }
Configure BlazeDS to allow remoting requests to the HelloWorld class by adding a destination to the remoting-config.xml file found in the WEB-INF/flex directory. Use the following destination configuration:
HelloWorld
Start your application server and verify your web application is configured by going to the following URL (The port may vary depending on your application server configuration): http://localhost:8080/blazeds/ (If your server is not configured to display directory contents, you might see a 404 error. This is OK.)
Create a new Flex Project
For the project name, type "testHelloWorld"
Select "J2EE" as the Application Server Type
Select "Use remote object access service" and LiveCycle Data Services
Specify the Root folder to be to location of your deployed WAR file
Specify the Root URL to be: http://localhost:8080/blazeds (Your port name may be different depending on your application server configuration)
Specify the Context Root to be: /blazeds
Verify the configuration and click Finish
Create the Flex application by updating the testHelloWorld.mxml file with the following source code:
Run the application and test it by typing your name into the TextInput box. You should see "hello, " displayed beneath the TextInput like the image below.
No comments:
Post a Comment