How to create a Flex project with java Env so you can compile and debug it in Jboss directly?
1: create a new folder in $JBOSS_HOME/server/default/deploy, Eg. flexEnv.war
2: extract the flex.war (you can find this sample package in the flex-dataservice folder) to the flexEnv.war
3: remove the jrun-web.xml in the WEB-INF folder
4: copy a jboss-web.xml into the WEB-INF folder, set the context-root as flexEnv
5: create a flex project in the FlexBuilder(I use the version 3.0), eg. flexEnv
project name: flexEnv
Application type: web application
server technology: J2ee
user remote object access service/livecycle data services
Root folder: $JBOSS_HOME/server/default/deploy/flexEnv.war
Rott URL: http://localhost:8080/flexEnv
Context root: /flexEnv
Output folder: $JBOSS_HOME/server/default/deploy/flexEnv.war/webApp
Main source folder: webApp
6: now you have a flex project name flexEnv. the next step is to add the java project nature to this project.
7: close this project
8: open the .project under your project folder.
9: add the java build command and nature and classes link to the project.
10: open the project
11: now open the property page of this project, you will find that both the flex and java setting pages are here.
12: create a folder "conf" in the project folder. here we will put the config files, like the remoteServices.xml.
13: copy services-config.xml, remoting-config.xml, proxy-config.xml, messaging-config.xml, data-management-config.xml
from the $JBOSS_HOME/server/default/deploy/flexEnv.war/WEB-INF/flex to the the conf folder.
So we can do the modification to these config files and save them in our project folder.
14: set the -services to the services-config.xml in the conf folder.
15: now build the project. you will find that a flexEnv.swf is generated in the $JBOSS_HOME/server/default/deploy/flexEnv.war/webApp.
16: visit the swf file by: http://localhost:8080/flexEnv/webApp/flexEnv.swf
17: now let's test the java code.
18: create a link folder: classes and refer it to $JBOSS_HOME/server/default/deploy/flexEnv.war/WEB-INF/classes.
19: open the property page of the project and go to the "java build path", open the source tab, and set the output folder to flexEnv/classes.
the source folder is flexEnv/src.
20: create a java class like : org.test.Hello
21: build the project and you will find that the class file is generated under the $JBOSS_HOME/server/default/deploy/flexEnv.war/WEB-INF/classes.
so now we make it.