netbeans + flex 第一个DEMO

来源:互联网 发布:淘宝上怎么买正品货 编辑:程序博客网 时间:2024/04/29 21:28

  首先建一个netbeans的java web项目

然后从网上吧blazeds.war 下载下来用rar 解压 把web-inf 替换掉在netbeans/web 下面的web-inf中的全部文件

然后 部署下

在打开flex builder 新建一个flex project 写上名字和项目路径

在Application server type 选中j2ee

点击 下一步

然后 Root folder选中netbeans 建的项目 下的web路径 例如E:/学习/WebDemo/web  {我的项目交WebDemo}

Root Url 写上你的服务器url路径  例如:http://localhost:8080/WebDemo

Context root 还是/WebDemo

 在output folder 这里注意一下 比如我的项目是E:/学习/WebDemo/ 这个路径下 那么写E:/学习/WebDemo/web  这样的话flex builfer就会把生成的文件都放在web下面了

然后下一步 ok 现在项目算是搭建完事了

现在修改配置文件netbeans 下面的web/web-inf/flex/remoting-config.xml

<destination id="helloWorld">
            <properties>
            <source>cn.demo.java.HelloWorld</source>
            </properties>
        </destination>

这些是我新加的 helloWrold 是自己新建的名字

 com.demo.java.HelloWorld 是我新建的类

里面代码如下

 

这样服务器端暂时完事了

打开flex端 WebDemo.mxml

插入代码

 

OK结束 运行flex builder就OK了 在文本框里数个字 点下按钮