Flex+BlazeDS整合J2ee示例
2010-09-06 11:13
405 查看
一、首先配置好eclipse下Flex开发环境
http://blog.csdn.net/hujingn/archive/2010/08/31/5853691.aspx
二、下载部署BlazeDS
http://download.csdn.net/source/2665805
将下载的blazeds.war包,放入%TOMCAT_HOME%/webapps目录下。
三、创建Flex项目
使用MyEclipse加入web project
创建好后项目目录结构
然后使用eclipse把项目部署到tomcat下
四、应用
1、切换到Java透视图下,在src目录下创建Hello.java
3、切换回Flex Development透视图,编辑flex_src/flexsample.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#ffffff">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
function gg(evnet:ResultEvent):void{
var ff:String = evnet.result as String;
ggg.text = ff;
}
function remotingSayHello():void{
var sname:String = nameInput.text;
h.hello(sname);
}
]]>
</mx:Script>
<mx:RemoteObject destination="hello" id="h" result="gg(event)" endpoint="http://localhost:8080/flexsample/messagebroker/amf" >
</mx:RemoteObject>
<mx:TextArea id="ggg" x="109" y="122"/>
<mx:Button label="say hello" click="remotingSayHello();" x="144" y="193"/>
<mx:TextInput id="nameInput" x="109" y="73"/>
<mx:Label text="name" x="47" y="75"/>
</mx:Application>
重启tomcat
在flexsample.mxml文件上右键run as->Flex Application
在eclipse控制台也会打印出:
flex调用我了,真好!!!
http://blog.csdn.net/hujingn/archive/2010/08/31/5853691.aspx
二、下载部署BlazeDS
http://download.csdn.net/source/2665805
将下载的blazeds.war包,放入%TOMCAT_HOME%/webapps目录下。
三、创建Flex项目
使用MyEclipse加入web project
创建好后项目目录结构
然后使用eclipse把项目部署到tomcat下
四、应用
1、切换到Java透视图下,在src目录下创建Hello.java
<destination id="hello"> <properties> <source>com.flex.Hello</source> </properties> </destination>
3、切换回Flex Development透视图,编辑flex_src/flexsample.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#ffffff">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
function gg(evnet:ResultEvent):void{
var ff:String = evnet.result as String;
ggg.text = ff;
}
function remotingSayHello():void{
var sname:String = nameInput.text;
h.hello(sname);
}
]]>
</mx:Script>
<mx:RemoteObject destination="hello" id="h" result="gg(event)" endpoint="http://localhost:8080/flexsample/messagebroker/amf" >
</mx:RemoteObject>
<mx:TextArea id="ggg" x="109" y="122"/>
<mx:Button label="say hello" click="remotingSayHello();" x="144" y="193"/>
<mx:TextInput id="nameInput" x="109" y="73"/>
<mx:Label text="name" x="47" y="75"/>
</mx:Application>
重启tomcat
在flexsample.mxml文件上右键run as->Flex Application
在eclipse控制台也会打印出:
flex调用我了,真好!!!
相关文章推荐
- Flex+BlazeDS整合J2ee示例
- Flex+BlazeDS整合J2ee示例
- Flex+BlazeDS+Spring+Hibernate架构整合示例
- BlazeDS 整合 Flex HelloWorld 示例
- BlazeDS 整合 Flex HelloWorld 示例
- Flex+BlazeDS整合J2EE实例
- BlazeDS 整合 Flex HelloWorld 示例
- Flex+BlazeDS整合J2EE实例
- Flex+BlazeDS整合J2EE实例
- Flex+BlazeDS+Spring+Hibernate架构整合示例
- 通过J2EE Web工程添加Flex项目,进行BlazeDS开发
- flex整合blazeds,spring,hibernate应用
- Flex + blazeds + J2EE 数据交互入门实例教程(图) (转)
- Flex4系列教程之七 – 整合Flex,BlazeDS,Spring(>= 2.5.6)
- flex j2EE 例子 和BlazeDs 关于MessageBroker,endpoints 和 channels
- arcgis api for flex之四、使用BlazeDS与Flash Builder4.5整合Java EE应用
- Flex4+Spring3+Hibernate3+BlazeDS整合笔记
- Flex Spring JAVA BLAZEDS整合
- flex 整合 struts 的一个简单示例(使用Httpservice)
- 使用WTP整合Flex和J2EE